Skip to content

Commit

Permalink
deps: update golangci/golangci-lint-action action to v3.7.1 (#581)
Browse files Browse the repository at this point in the history
* deps: update golangci/golangci-lint-action action to v3.7.1
* Fix linting issues

---------

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Feb 9, 2024
1 parent c33669b commit fd93d66
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804 # v3.7.1
with:
skip-pkg-cache: true
skip-build-cache: true
Expand Down
2 changes: 1 addition & 1 deletion cli/internal/cmd/manifest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ func TestCliManifestVerify(t *testing.T) {
}

func TestGetSignatureFromString(t *testing.T) {
assert := assert.New(t)
require := require.New(t)

testValue := []byte(`{"TestSignature": "signature"}`)
Expand Down Expand Up @@ -357,6 +356,7 @@ func TestGetSignatureFromString(t *testing.T) {

for name, tc := range testCases {
t.Run(name, func(t *testing.T) {
assert := assert.New(t)
testSignature, err := getSignatureFromString(tc.signature, tc.fs)
if tc.wantErr {
assert.Error(err)
Expand Down
8 changes: 4 additions & 4 deletions cli/internal/rest/rest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func newTestClient(fn roundTripFunc) *http.Client {

func TestGet(t *testing.T) {
require := require.New(t)
defaultResponseFunc := func(req *http.Request) *http.Response {
defaultResponseFunc := func(_ *http.Request) *http.Response {
response := server.GeneralResponse{
Message: "response message",
Data: "response data",
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestGet(t *testing.T) {
wantErr: true,
},
"server error": {
roundTripFunc: func(req *http.Request) *http.Response {
roundTripFunc: func(_ *http.Request) *http.Response {
return &http.Response{
StatusCode: http.StatusInternalServerError,
Body: io.NopCloser(&bytes.Reader{}),
Expand Down Expand Up @@ -111,7 +111,7 @@ func TestGet(t *testing.T) {

func TestPost(t *testing.T) {
require := require.New(t)
defaultResponseFunc := func(req *http.Request) *http.Response {
defaultResponseFunc := func(_ *http.Request) *http.Response {
response := server.GeneralResponse{
Message: "response message",
Data: "response data",
Expand Down Expand Up @@ -142,7 +142,7 @@ func TestPost(t *testing.T) {
wantResponse: []byte("response data"),
},
"server error": {
roundTripFunc: func(req *http.Request) *http.Response {
roundTripFunc: func(_ *http.Request) *http.Response {
return &http.Response{
StatusCode: http.StatusInternalServerError,
Body: io.NopCloser(&bytes.Reader{}),
Expand Down
2 changes: 1 addition & 1 deletion cmd/marble-injector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func main() {
// We need to use this function since the certificate may be updated by cert-manager,
// requiring us to reload the certificate.
func loadWebhookCert(certFile, keyFile string) func(chi *tls.ClientHelloInfo) (*tls.Certificate, error) {
return func(chi *tls.ClientHelloInfo) (*tls.Certificate, error) {
return func(_ *tls.ClientHelloInfo) (*tls.Certificate, error) {
pair, err := tls.LoadX509KeyPair(certFile, keyFile)
if err != nil {
return nil, fmt.Errorf("failed loading tls key pair: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion cmd/marble-test/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func runServer(addr string) {
}

// handle '/' route
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
http.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) {
fmt.Fprint(w, "Welcome to this Marbelous world!")
})

Expand Down
2 changes: 1 addition & 1 deletion coordinator/events/eventlog.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (l *Log) Activation(marbleType string, uuid string, quote []byte) {

// Handler returns a http.HandlerFunc which writes the log as JSON array.
func (l *Log) Handler() http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
return http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
_ = json.NewEncoder(w).Encode(l.events)
Expand Down
2 changes: 1 addition & 1 deletion coordinator/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func RunPrometheusServer(address string, zapLogger *zap.Logger, reg *prometheus.
}

func middlewareLogger(log *zap.Logger) logging.Logger {
return logging.LoggerFunc(func(ctx context.Context, lvl logging.Level, msg string, fields ...any) {
return logging.LoggerFunc(func(_ context.Context, lvl logging.Level, msg string, fields ...any) {
f := make([]zap.Field, 0, len(fields)/2)

for i := 0; i < len(fields); i += 2 {
Expand Down
2 changes: 1 addition & 1 deletion coordinator/updatelog/updatelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
)

func init() {
_ = zap.RegisterSink("updatelog", func(u *url.URL) (zap.Sink, error) {
_ = zap.RegisterSink("updatelog", func(_ *url.URL) (zap.Sink, error) {
return newSink, nil
})
}
Expand Down

0 comments on commit fd93d66

Please sign in to comment.