From 74d75040bf1652c740a27caf147341ffbfedde14 Mon Sep 17 00:00:00 2001 From: baiyutang Date: Mon, 27 May 2024 23:24:33 +0800 Subject: [PATCH] chore(gomall/tutorial): ch10 --- .../app/frontend/biz/handler/category/category_service.go | 1 - gomall/tutorial/ch10/app/product/go.mod | 1 + gomall/tutorial/ch10/app/product/go.sum | 2 ++ gomall/tutorial/ch10/app/product/main.go | 5 ++++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gomall/tutorial/ch10/app/frontend/biz/handler/category/category_service.go b/gomall/tutorial/ch10/app/frontend/biz/handler/category/category_service.go index 9098941..06d123a 100644 --- a/gomall/tutorial/ch10/app/frontend/biz/handler/category/category_service.go +++ b/gomall/tutorial/ch10/app/frontend/biz/handler/category/category_service.go @@ -20,7 +20,6 @@ import ( "github.com/cloudwego/biz-demo/gomall/app/frontend/biz/service" "github.com/cloudwego/biz-demo/gomall/app/frontend/biz/utils" category "github.com/cloudwego/biz-demo/gomall/app/frontend/hertz_gen/frontend/category" - common "github.com/cloudwego/biz-demo/gomall/app/frontend/hertz_gen/frontend/common" "github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/protocol/consts" ) diff --git a/gomall/tutorial/ch10/app/product/go.mod b/gomall/tutorial/ch10/app/product/go.mod index 2a5fad3..403393b 100644 --- a/gomall/tutorial/ch10/app/product/go.mod +++ b/gomall/tutorial/ch10/app/product/go.mod @@ -80,5 +80,6 @@ require ( google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/gomall/tutorial/ch10/app/product/go.sum b/gomall/tutorial/ch10/app/product/go.sum index 8f0f1d4..7f11073 100644 --- a/gomall/tutorial/ch10/app/product/go.sum +++ b/gomall/tutorial/ch10/app/product/go.sum @@ -578,6 +578,8 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntN gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/validator.v2 v2.0.1 h1:xF0KWyGWXm/LM2G1TrEjqOu4pa6coO9AlWSf3msVfDY= gopkg.in/validator.v2 v2.0.1/go.mod h1:lIUZBlB3Im4s/eYp39Ry/wkR02yOPhZ9IwIRBjuPuG8= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/gomall/tutorial/ch10/app/product/main.go b/gomall/tutorial/ch10/app/product/main.go index 67fae46..ca3de58 100644 --- a/gomall/tutorial/ch10/app/product/main.go +++ b/gomall/tutorial/ch10/app/product/main.go @@ -28,6 +28,7 @@ import ( kitexlogrus "github.com/kitex-contrib/obs-opentelemetry/logging/logrus" consul "github.com/kitex-contrib/registry-consul" "go.uber.org/zap/zapcore" + "gopkg.in/natefinch/lumberjack.v2" ) func main() { @@ -52,7 +53,9 @@ func kitexInit() (opts []server.Option) { opts = append(opts, server.WithServiceAddr(addr)) r, err := consul.NewConsulRegister(conf.GetConf().Registry.RegistryAddress[0]) - + if err != nil { + klog.Fatal(err) + } // service info opts = append(opts, server.WithServerBasicInfo(&rpcinfo.EndpointBasicInfo{ ServiceName: conf.GetConf().Kitex.Service,