-
Notifications
You must be signed in to change notification settings - Fork 481
fix some linting failures and configure golangci-lint #922
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
9f4e90f
5123511
d43e9c0
3c6d537
95d354e
c7a5922
d46d949
349843d
28a0dbc
e8ae554
d7c3b59
051df90
ce73ead
5015f94
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
linters: | ||
# Disable all linters. | ||
# Default: false | ||
disable-all: true | ||
# Enable specific linter | ||
# https://golangci-lint.run/usage/linters/#enabled-by-default | ||
enable: | ||
# default linter | ||
# - errcheck # there are to many failures at the moment | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- staticcheck | ||
- unused | ||
# custom linter | ||
- gofmt |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,10 +35,10 @@ htmlcov: | |
go test -v -coverpkg=./... -coverprofile=c.out ./... | ||
go tool cover -html ./c.out | ||
|
||
|
||
lint: | ||
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. Maybe we change this to also run golangci-lint.
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 think 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. Hah, didn't even notice that, yeah.. we can replace So much has changed in the go ecosystem since Goss was originally written. |
||
$(info INFO: Starting build $@) | ||
golint $(pkgs) || true | ||
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59 | ||
golangci-lint run --timeout 5m $(pkgs) || true | ||
|
||
vet: | ||
$(info INFO: Starting build $@) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,8 @@ type Addr struct { | |
Skip bool `json:"skip,omitempty" yaml:"skip,omitempty"` | ||
} | ||
|
||
type idKey struct{} | ||
|
||
const ( | ||
AddrResourceKey = "addr" | ||
AddResourceName = "Addr" | ||
|
@@ -51,7 +53,7 @@ func (a *Addr) GetAddress() string { | |
} | ||
|
||
func (a *Addr) Validate(sys *system.System) []TestResult { | ||
ctx := context.WithValue(context.Background(), "id", a.ID()) | ||
ctx := context.WithValue(context.Background(), idKey{}, a.ID()) | ||
Comment on lines
-54
to
+56
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. The issue was:
|
||
skip := a.Skip | ||
|
||
if a.Timeout == 0 { | ||
|
Uh oh!
There was an error while loading. Please reload this page.