test
continuous-integration/drone/push Build was killed Details

master
icechen 2021-12-29 23:27:19 +08:00
parent eee7882557
commit 41daeab7b0
5 changed files with 5 additions and 10 deletions

View File

@ -9,7 +9,6 @@ WORKDIR /go/src
ADD . .
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o api_example_api ./app/api/example_api
FROM alpine as example_api
WORKDIR /go/src
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo

View File

@ -1,6 +1,8 @@
package main
import "git.icechen.cn/pkg/go-template/app/service/example_service/pkg/user"
import (
"git.icechen.cn/pkg/go-template/app/service/example_service/internal/user"
)
func main() {
user.RpcServer()

View File

@ -1,7 +0,0 @@
package user2
import "fmt"
func CreateUser() {
fmt.Println("create user")
}

View File

@ -3,11 +3,12 @@ package rpc
import (
"google.golang.org/grpc"
"os"
"strings"
)
// GetServiceConn 获取服务的连接
func GetServiceConn(serviceName string) *grpc.ClientConn {
target := os.Getenv("SERVICE_" + serviceName)
target := strings.ToUpper(os.Getenv("SERVICE_" + serviceName))
cli, _ := grpc.Dial(target, grpc.WithInsecure())
return cli
}