use goproxy properly, remove files (#1903)

This commit is contained in:
Kevin Wan
2022-05-14 16:00:20 +08:00
committed by GitHub
parent 1e717f9f5c
commit 5d09cd0e7c
5 changed files with 26 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ import (
"path/filepath"
"runtime"
"strings"
"time"
"github.com/zeromicro/go-zero/tools/goctl/vars"
)
@@ -16,8 +17,15 @@ const (
binProtoc = "protoc"
binProtocGenGo = "protoc-gen-go"
binProtocGenGrpcGo = "protoc-gen-go-grpc"
cstOffset = 60 * 60 * 8 // 8 hours offset for Chinese Standard Time
)
// InChina returns whether the current time is in China Standard Time.
func InChina() bool {
_, offset := time.Now().Zone()
return offset == cstOffset
}
// LookUpGo searches an executable go in the directories
// named by the GOROOT/bin or PATH environment variable.
func LookUpGo() (string, error) {