chore: coding style for quickstart (#1902)

This commit is contained in:
Kevin Wan
2022-05-13 23:10:55 +08:00
committed by GitHub
parent e567a0c718
commit c6e2b4a43a
3 changed files with 33 additions and 33 deletions

View File

@@ -1,22 +1,22 @@
package svc
import (
"github.com/zeromicro/go-zero/zrpc"
"greet/api/internal/config"
"greet/rpc/greet"
"github.com/zeromicro/go-zero/zrpc"
"greet/api/internal/config"
"greet/rpc/greet"
)
type ServiceContext struct {
Config config.Config
GreetRpc greet.Greet
Config config.Config
GreetRpc greet.Greet
}
func NewServiceContext(c config.Config) *ServiceContext {
client := zrpc.MustNewClient(zrpc.RpcClientConf{
Target: "127.0.0.1:8080",
})
return &ServiceContext{
Config: c,
GreetRpc: greet.NewGreet(client),
}
client := zrpc.MustNewClient(zrpc.RpcClientConf{
Target: "127.0.0.1:8080",
})
return &ServiceContext{
Config: c,
GreetRpc: greet.NewGreet(client),
}
}