package orderrpcv2 import ( "git.tetele.net/tgo/conf" ) func rpc_server_conn(url ...string) (*OrderServiceClient, error) { var rpc_url string if len(url) > 0 && url[0] != "" { rpc_url = url[0] } else if conf.ORDER_RPC_V2_URL != "" { rpc_url = conf.ORDER_RPC_V2_URL } else { rpc_url = "127.0.0.1:" + conf.ORDER_RPC_V2_PORT } conn, _, err := DialOrderService("tcp", rpc_url) if err != nil { return nil, err } return conn, nil }