chore: coding style (#2120)
This commit is contained in:
@@ -38,7 +38,7 @@ func initRPCProto() error {
|
||||
|
||||
protoFilename := filepath.Join(zrpcWorkDir, protoName)
|
||||
rpcBytes := []byte(protocContent)
|
||||
return ioutil.WriteFile(protoFilename, rpcBytes, 0666)
|
||||
return ioutil.WriteFile(protoFilename, rpcBytes, 0o666)
|
||||
}
|
||||
|
||||
type micro struct{}
|
||||
@@ -55,7 +55,7 @@ func (m micro) mustStartRPCProject() {
|
||||
arg := "goctl rpc protoc " + protoName + " --go_out=. --go-grpc_out=. --zrpc_out=. --verbose"
|
||||
execCommand(zrpcWorkDir, arg)
|
||||
etcFile := filepath.Join(zrpcWorkDir, "etc", "greet.yaml")
|
||||
logx.Must(ioutil.WriteFile(etcFile, []byte(rpcEtcContent), 0666))
|
||||
logx.Must(ioutil.WriteFile(etcFile, []byte(rpcEtcContent), 0o666))
|
||||
}
|
||||
|
||||
func (m micro) start() {
|
||||
|
||||
@@ -35,7 +35,7 @@ func initAPIFlags() error {
|
||||
|
||||
apiFilename := filepath.Join(apiWorkDir, "greet.api")
|
||||
apiBytes := []byte(apiContent)
|
||||
if err := ioutil.WriteFile(apiFilename, apiBytes, 0666); err != nil {
|
||||
if err := ioutil.WriteFile(apiFilename, apiBytes, 0o666); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func (m mono) createAPIProject() {
|
||||
log.Debug(">> Generating quickstart api project...")
|
||||
logx.Must(gogen.GoCommand(nil, nil))
|
||||
etcFile := filepath.Join(apiWorkDir, "etc", "greet.yaml")
|
||||
logx.Must(ioutil.WriteFile(etcFile, []byte(apiEtcContent), 0666))
|
||||
logx.Must(ioutil.WriteFile(etcFile, []byte(apiEtcContent), 0o666))
|
||||
logicFile := filepath.Join(apiWorkDir, "internal", "logic", "pinglogic.go")
|
||||
svcFile := filepath.Join(apiWorkDir, "internal", "svc", "servicecontext.go")
|
||||
configPath := filepath.Join(apiWorkDir, "internal", "config")
|
||||
|
||||
@@ -20,7 +20,7 @@ func goModTidy(dir string) int {
|
||||
return execCommand(dir, "go mod tidy", prepareGoProxyEnv()...)
|
||||
}
|
||||
|
||||
func execCommand(dir string, arg string, envArgs ...string) int {
|
||||
func execCommand(dir, arg string, envArgs ...string) int {
|
||||
cmd := exec.Command("sh", "-c", arg)
|
||||
if runtime.GOOS == vars.OsWindows {
|
||||
cmd = exec.Command("cmd.exe", "/c", arg)
|
||||
|
||||
Reference in New Issue
Block a user