Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
  • Loading branch information
daniel-weisse committed Feb 9, 2024
1 parent c79345a commit efc4b8e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
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/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 efc4b8e

Please sign in to comment.