Skip to content

Commit

Permalink
Fix issues reported by golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
arnested committed Sep 18, 2024
1 parent 09c416d commit 8a97b1f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"syscall"
"time"

"github.com/docker/docker/api/types"
typesContainer "github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/events"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"ldddns.arnested.dk/internal/container"
Expand Down Expand Up @@ -126,7 +126,7 @@ func listen(ctx context.Context, config Config, docker *client.Client, egs *entr
filter.Add("event", "start")
filter.Add("event", "unpause")

msgs, errs := docker.Events(ctx, types.EventsOptions{
msgs, errs := docker.Events(ctx, events.ListOptions{

Check warning on line 129 in container.go

View check run for this annotation

Codecov / codecov/patch

container.go#L129

Added line #L129 was not covered by tests
Filters: filter,
Since: strconv.FormatInt(started.Unix(), 10),
Until: "",
Expand Down
2 changes: 1 addition & 1 deletion internal/container/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (c Container) Services() map[string]uint16 {
continue
}

//nolint:gomnd
//nolint:mnd,gomnd
if portNumber > 65535 {
log.Logf(log.PriErr, "Port number %d is too large", portNumber)

Check warning on line 61 in internal/container/container.go

View check run for this annotation

Codecov / codecov/patch

internal/container/container.go#L61

Added line #L61 was not covered by tests

Expand Down
5 changes: 2 additions & 3 deletions internal/hostname/hostname_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ func TestRewriteHostname(t *testing.T) {
}

for _, tt := range testdata {
tt := tt
t.Run(tt.in, func(t *testing.T) {
t.Logf("%q %q\n", tt.in, tt.out)
t.Parallel()

if s := hostname.RewriteHostname(tt.in); s != tt.out {
t.Errorf("got %q from %q, want %q", s, tt.in, tt.out)
}
Expand All @@ -130,7 +129,7 @@ func FuzzRewriteHostname(f *testing.F) {
f.Add("blåbærgrød")
f.Add("xn--blbrgrd-fxak7p.local")

f.Fuzz(func(t *testing.T, a string) {
f.Fuzz(func(_ *testing.T, a string) {
hostname.RewriteHostname(a)
})
}

0 comments on commit 8a97b1f

Please sign in to comment.