chore: coding style for quickstart (#1902)
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user