-
Notifications
You must be signed in to change notification settings - Fork 105
[V3] updated go and lint version #1532
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
Changes from all commits
f198c78
dc3d6b9
ae4e16b
699ea8c
06c9569
23ac557
1bf84e7
bd840ff
fdaf943
d7995cf
dc13736
d192467
078cc9f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| OAPICODEGEN = github.com/deepmap/oapi-codegen/v2/cmd/[email protected] | ||
| LEFTHOOK = github.com/evilmartians/[email protected] | ||
| GOLANGCILINT = github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0 | ||
| GOLANGCILINT = github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.0 | ||
| PROTOCGENGO = google.golang.org/protobuf/cmd/[email protected] | ||
| GOFUMPT = mvdan.cc/[email protected] | ||
| COUNTERFEITER = github.com/maxbrunsfeld/counterfeiter/v6@v6.8.1 | ||
| COUNTERFEITER = github.com/maxbrunsfeld/counterfeiter/v6@v6.11.2 | ||
| NFPM = github.com/goreleaser/nfpm/v2/cmd/[email protected] | ||
| GOTESTCOVERAGE = github.com/vladopajic/go-test-coverage/[email protected] | ||
| BENCHSTAT = golang.org/x/perf/cmd/[email protected] | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,8 @@ import ( | |||||||||||||
| "strconv" | ||||||||||||||
| "testing" | ||||||||||||||
|
|
||||||||||||||
| "github.com/stretchr/testify/assert" | ||||||||||||||
| "github.com/pkg/errors" | ||||||||||||||
| "github.com/stretchr/testify/require" | ||||||||||||||
| ) | ||||||||||||||
|
|
||||||||||||||
| func TestCollectCPUStats(t *testing.T) { | ||||||||||||||
|
|
@@ -79,10 +80,18 @@ func TestCollectCPUStats(t *testing.T) { | |||||||||||||
| cpuStat, err := cgroupCPUSource.collectCPUStats(ctx) | ||||||||||||||
|
|
||||||||||||||
| // Assert error | ||||||||||||||
| assert.IsType(tt, test.errorType, err) | ||||||||||||||
| if test.errorType == nil { | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead would something like this work ?
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this change not work with the linter ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did fix the code based on the review comment. |
||||||||||||||
| require.NoError(tt, err) | ||||||||||||||
| } else { | ||||||||||||||
| require.Error(tt, err) | ||||||||||||||
| // satisfy the linter's requirement for a more specific check than IsType. | ||||||||||||||
| require.Condition(tt, func() bool { | ||||||||||||||
| return errors.As(err, &test.errorType) | ||||||||||||||
| }, "Error should be of type %T", test.errorType) | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| // Assert result | ||||||||||||||
| assert.Equal(tt, test.cpuStat, cpuStat) | ||||||||||||||
| require.Equal(tt, test.cpuStat, cpuStat) | ||||||||||||||
| }) | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.