diff --git a/examples/swagger/server/main.go b/examples/swagger/server/main.go index fad644452..26787b875 100644 --- a/examples/swagger/server/main.go +++ b/examples/swagger/server/main.go @@ -6,7 +6,7 @@ import ( "os" pb "github.com/go-kratos/kratos/examples/swagger/helloworld" - reply "github.com/go-kratos/kratos/examples/swagger/reply" + "github.com/go-kratos/kratos/examples/swagger/reply" "github.com/go-kratos/kratos/v2" "github.com/go-kratos/kratos/v2/errors" "github.com/go-kratos/kratos/v2/log" @@ -28,7 +28,7 @@ type server struct { } // SayHello implements helloworld.GreeterServer -func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) { +func (s *server) SayHello(_ context.Context, in *pb.HelloRequest) (*pb.HelloReply, error) { if in.Name == "error" { return nil, errors.BadRequest("custom_error", fmt.Sprintf("invalid argument %s", in.Name)) } @@ -40,9 +40,9 @@ func (s *server) SayHello(ctx context.Context, in *pb.HelloRequest) (*pb.HelloRe } func main() { - logger := log.NewStdLogger(os.Stdout) + stdLogger := log.NewStdLogger(os.Stdout) - log := log.NewHelper(logger) + logger := log.NewHelper(stdLogger) s := &server{} httpSrv := http.NewServer(http.Address(":8000")) @@ -62,6 +62,6 @@ func main() { ) if err := app.Run(); err != nil { - log.Error(err) + logger.Error(err) } }