From c3de800938b910e13a0b3a0387b0b544c657a926 Mon Sep 17 00:00:00 2001 From: kwanhur Date: Mon, 7 Mar 2022 13:20:55 +0800 Subject: [PATCH] chore(examples): optimize typos of swagger/server (#1862) --- examples/swagger/server/main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) } }