Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update golangci-lint from v1.58.0 to v1.59.0 #15473

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- run: 'make check-deps'
- run:
name: "Install golangci-lint"
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.0
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
- run:
name: "golangci-lint/Linux"
command: GOGC=80 GOMEMLIMIT=6656MiB /go/bin/golangci-lint run --verbose
Expand All @@ -117,7 +117,7 @@ jobs:
- check-changed-files-or-halt
- run:
name: "Install golangci-lint"
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.0
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
- run:
name: "golangci-lint/macOS"
command: GOGC=80 GOMEMLIMIT=6656MiB GOOS=darwin /go/bin/golangci-lint run --verbose --timeout=30m
Expand All @@ -129,7 +129,7 @@ jobs:
- check-changed-files-or-halt
- run:
name: "Install golangci-lint"
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.0
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0
- run:
name: "golangci-lint/Windows"
command: GOGC=80 GOMEMLIMIT=6656MiB GOOS=windows /go/bin/golangci-lint run --verbose --timeout=30m
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ vet:
.PHONY: lint-install
lint-install:
@echo "Installing golangci-lint"
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.58.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0

@echo "Installing markdownlint"
npm install -g markdownlint-cli
Expand Down
4 changes: 2 additions & 2 deletions models/running_output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ func TestRetryableStartupBehaviorRetry(t *testing.T) {

// For retry, Connect() should succeed even though there is an error but
// should return an error on Write() until we successfully connect.
require.NoError(t, ro.Connect(), serr)
require.NotErrorIs(t, ro.Connect(), serr)
require.False(t, ro.started)

ro.AddMetric(testutil.TestMetric(1))
Expand Down Expand Up @@ -724,7 +724,7 @@ func TestPartiallyStarted(t *testing.T) {

// For retry, Connect() should succeed even though there is an error but
// should return an error on Write() until we successfully connect.
require.NoError(t, ro.Connect(), serr)
require.NotErrorIs(t, ro.Connect(), serr)
require.False(t, ro.started)

ro.AddMetric(testutil.TestMetric(1))
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/directory_monitor/directory_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ func (monitor *DirectoryMonitor) moveFile(srcPath string, dstBaseDir string) {
// creates those subdirectories.
basePath := strings.Replace(srcPath, monitor.Directory, "", 1)
dstPath := filepath.Join(dstBaseDir, basePath)
err := os.MkdirAll(filepath.Dir(dstPath), os.ModePerm)
err := os.MkdirAll(filepath.Dir(dstPath), 0750)
if err != nil {
monitor.Log.Errorf("Error creating directory hierarchy for " + srcPath + ". Error: " + err.Error())
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/inputs/directory_monitor/directory_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ func TestParseSubdirectories(t *testing.T) {
require.NoError(t, err)

// Write json file to process into a subdirectory in the 'process' directory.
err = os.Mkdir(filepath.Join(processDirectory, "sub"), os.ModePerm)
err = os.Mkdir(filepath.Join(processDirectory, "sub"), 0750)
require.NoError(t, err)
f, err = os.Create(filepath.Join(processDirectory, "sub", testJSONFile))
require.NoError(t, err)
Expand Down Expand Up @@ -656,7 +656,7 @@ func TestParseSubdirectoriesFilesIgnore(t *testing.T) {
require.NoError(t, err)

// Write json file to process into a subdirectory in the 'process' directory.
err = os.Mkdir(filepath.Join(processDirectory, "sub"), os.ModePerm)
err = os.Mkdir(filepath.Join(processDirectory, "sub"), 0750)
require.NoError(t, err)
f, err = os.Create(filepath.Join(processDirectory, "sub", testJSONFile))
require.NoError(t, err)
Expand Down
12 changes: 6 additions & 6 deletions plugins/inputs/linux_cpu/linux_cpu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func TestNoCPUs(t *testing.T) {
func TestNoCPUMetrics(t *testing.T) {
td := t.TempDir()

require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/cpufreq", os.ModePerm))
require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/cpufreq", 0750))

plugin := &LinuxCPU{
Log: testutil.Logger{Name: "LinuxCPUPluginTest"},
Expand All @@ -43,12 +43,12 @@ func TestNoCPUMetrics(t *testing.T) {
func TestGatherCPUFreq(t *testing.T) {
td := t.TempDir()

require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/cpufreq", os.ModePerm))
require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/cpufreq", 0750))
srebhan marked this conversation as resolved.
Show resolved Hide resolved
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", []byte("250\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", []byte("100\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", []byte("255\n"), 0640))

require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu1/cpufreq", os.ModePerm))
require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu1/cpufreq", 0750))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu1/cpufreq/scaling_cur_freq", []byte("123\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu1/cpufreq/scaling_min_freq", []byte("80\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu1/cpufreq/scaling_max_freq", []byte("230\n"), 0640))
Expand Down Expand Up @@ -91,7 +91,7 @@ func TestGatherCPUFreq(t *testing.T) {
func TestGatherThermal(t *testing.T) {
td := t.TempDir()

require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/thermal_throttle", os.ModePerm))
require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/thermal_throttle", 0750))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/thermal_throttle/core_throttle_count", []byte("250\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/thermal_throttle/core_throttle_max_time_ms", []byte("100\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/thermal_throttle/core_throttle_total_time_ms", []byte("255\n"), 0640))
Expand All @@ -117,7 +117,7 @@ func TestGatherThermal(t *testing.T) {
func TestGatherPropertyRemoved(t *testing.T) {
td := t.TempDir()

require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/cpufreq", os.ModePerm))
require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/cpufreq", 0750))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", []byte("250\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", []byte("100\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", []byte("255\n"), 0640))
Expand Down Expand Up @@ -153,7 +153,7 @@ func TestGatherPropertyRemoved(t *testing.T) {
func TestGatherPropertyInvalid(t *testing.T) {
td := t.TempDir()

require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/cpufreq", os.ModePerm))
require.NoError(t, os.MkdirAll(td+"/devices/system/cpu/cpu0/cpufreq", 0750))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", []byte("ABC\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", []byte("100\n"), 0640))
require.NoError(t, os.WriteFile(td+"/devices/system/cpu/cpu0/cpufreq/scaling_max_freq", []byte("255\n"), 0640))
Expand Down
Loading