test
parent
bad04e55e9
commit
e1a02c8afb
|
@ -16,7 +16,7 @@ func main() {
|
|||
return err
|
||||
}
|
||||
|
||||
return c.JSON(userInfo)
|
||||
return c.JSON(userInfo.Name)
|
||||
})
|
||||
err := app.Listen(":8080")
|
||||
if err != nil {
|
||||
|
|
|
@ -9,7 +9,7 @@ import (
|
|||
|
||||
// GetServiceConn 获取服务的连接
|
||||
func GetServiceConn(serviceName string) *grpc.ClientConn {
|
||||
target := strings.ToUpper(os.Getenv("SERVICE_" + serviceName))
|
||||
target := os.Getenv(strings.ToUpper("SERVICE_" + serviceName))
|
||||
cli, err := grpc.Dial(target, grpc.WithInsecure())
|
||||
if err != nil {
|
||||
fmt.Println("target: " + target + " err: " + err.Error())
|
||||
|
|
Loading…
Reference in New Issue