Skip to content

Commit

Permalink
Support for new linters introduced in golangci-lint 1.55 (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertvolkmann authored Nov 6, 2023
1 parent da98043 commit 1d22706
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions cmd/internal/core/phone-home.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"sync"
"time"

"google.golang.org/protobuf/types/known/timestamppb"

"github.com/metal-stack/go-lldpd/pkg/lldp"
v1 "github.com/metal-stack/metal-api/pkg/api/v1"
"google.golang.org/protobuf/types/known/timestamppb"
)

const (
Expand Down Expand Up @@ -111,7 +112,7 @@ func (c *Core) send(ctx context.Context, event *v1.EventServiceSendRequest) (*v1
return nil, err
}
if s != nil {
c.log.Info("event", "send", s.Events, "failed", s.Failed)
c.log.Info("event", "send", s.GetEvents(), "failed", s.GetFailed())
}
return s, err
}
Expand All @@ -137,7 +138,7 @@ func (c *Core) phoneHome(ctx context.Context, msgs []phoneHomeMessage) {
c.metrics.CountError("send-provisioning")
}
if s != nil {
c.log.Info("phonehome sent", "machines", s.Events)
c.log.Info("phonehome sent", "machines", s.GetEvents())
}
}

Expand Down
4 changes: 2 additions & 2 deletions cmd/internal/switcher/templates/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ func renderToString(t *testing.T, tpl *template.Template, c *types.Conf) string
func readConf(t *testing.T, i string) types.Conf {
c := types.Conf{}
b, err := os.ReadFile(i)
require.Nil(t, err, "unexpected error when reading testing input")
require.NoError(t, err, "unexpected error when reading testing input")

err = yaml.Unmarshal(b, &c)

Check failure on line 94 in cmd/internal/switcher/templates/template_test.go

View workflow job for this annotation

GitHub Actions / Docker Build

the given struct should be annotated with the `yaml` tag (musttag)
require.Nil(t, err, "unexpected error when unmarshalling testing input")
require.NoError(t, err, "unexpected error when unmarshalling testing input")
return c
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/internal/switcher/types/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestFillVLANIDs(t *testing.T) {
},
}
err := c.FillVLANIDs(m)
require.Nil(t, err)
require.NoError(t, err)
require.Equal(t, uint16(1001), c.Ports.Vrfs["101001"].VLANID)
require.Equal(t, uint16(1002), c.Ports.Vrfs["101002"].VLANID)
require.Equal(t, uint16(1003), c.Ports.Vrfs["101003"].VLANID)
Expand Down

0 comments on commit 1d22706

Please sign in to comment.