package config import ( "os" "github.com/gogf/gf/contrib/registry/etcd/v2" "github.com/gogf/gf/contrib/rpc/grpcx/v2" ) func Endpoint() string { return os.Getenv("ETCD_ENDPOINTS") } func Etcd() { if Endpoint() != "" { grpcx.Resolver.Register(etcd.New(Endpoint())) } }