diff --git a/.golangci.yml b/.golangci.yml index 55582d61..05b277fe 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -137,6 +137,9 @@ issues: max-issues-per-linter: 0 # Maximum count of issues with the same text. max-same-issues: 0 + include: + - EXC0013 # revive: package comment should be of the form "(.+)..." + - EXC0014 # revive: comment on exported (.+) should be of the form "(.+)..." exclude-rules: # Allow using Uid, Gid in pkg/osutil. - path: "pkg/osutil/" @@ -145,3 +148,7 @@ issues: - path: _test\.go linters: - godot + # Disable revive.exported for constants. + - text: "exported: comment on exported const" + linters: + - revive diff --git a/pkg/guestagent/api/gen.go b/pkg/guestagent/api/gen.go index 8ed488c9..9822947f 100644 --- a/pkg/guestagent/api/gen.go +++ b/pkg/guestagent/api/gen.go @@ -1,2 +1,3 @@ //go:generate protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative guestservice.proto --descriptor_set_out=guestservice.pb.desc + package api diff --git a/pkg/guestagent/kubernetesservice/kubernetesservice.go b/pkg/guestagent/kubernetesservice/kubernetesservice.go index 86c8b9bb..e0e5d473 100644 --- a/pkg/guestagent/kubernetesservice/kubernetesservice.go +++ b/pkg/guestagent/kubernetesservice/kubernetesservice.go @@ -23,6 +23,7 @@ type Protocol string const ( // UDP/SCTP when lima port forwarding works on those protocols. + TCP Protocol = "TCP" ) diff --git a/pkg/start/start.go b/pkg/start/start.go index ffcb0193..c17645ba 100644 --- a/pkg/start/start.go +++ b/pkg/start/start.go @@ -324,13 +324,13 @@ func watchHostAgentEvents(ctx context.Context, inst *store.Instance, haStdoutPat type watchHostAgentEventsTimeoutKey = struct{} -// WithWatchHostAgentEventsTimeout sets the value of the timeout to use for +// WithWatchHostAgentTimeout sets the value of the timeout to use for // watchHostAgentEvents in the given Context. func WithWatchHostAgentTimeout(ctx context.Context, timeout time.Duration) context.Context { return context.WithValue(ctx, watchHostAgentEventsTimeoutKey{}, timeout) } -// watchHostAgentEventsTimeout returns the value of the timeout to use for +// watchHostAgentTimeout returns the value of the timeout to use for // watchHostAgentEvents contained in the given Context, or its default value. func watchHostAgentTimeout(ctx context.Context) time.Duration { if timeout, ok := ctx.Value(watchHostAgentEventsTimeoutKey{}).(time.Duration); ok {