Skip to content

Commit 3cf2c7a

Browse files
committed
update defaultEndpoint
1 parent d53c08f commit 3cf2c7a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

env/env.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package env
2+
3+
import "os"
4+
5+
func IsProd() bool {
6+
prod := os.Getenv("HDUHELP_PROD")
7+
return prod == "HDUHELP"
8+
}

grpcClient/conn.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package grpcclient
33
import (
44
"context"
55
"crypto/x509"
6-
"github.com/hduhelp/api-consulting/config"
6+
"github.com/hduhelp/api_open_sdk/env"
77
"google.golang.org/grpc/credentials"
88
"log"
99

@@ -22,7 +22,7 @@ func Conn(ctx context.Context, endpoints ...string) (conn *grpc.ClientConn) {
2222
endpoint = defaultEndpoint
2323
}
2424
var err error
25-
if !config.IsProd() {
25+
if !env.IsProd() {
2626
certPool, err := x509.SystemCertPool()
2727
if err != nil {
2828
log.Fatalf("failed to load credentials: %v", err)

0 commit comments

Comments
 (0)