format coding style (#969)

master
Kevin Wan 3 years ago committed by GitHub
parent 3203f8e06b
commit 519db812b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -63,7 +63,7 @@ func (g *RPCGenerator) Generate(src, target string, protoImportPath []string, go
return err return err
} }
dirCtx, err := mkdir(projectCtx, proto,g.cfg) dirCtx, err := mkdir(projectCtx, proto, g.cfg)
if err != nil { if err != nil {
return err return err
} }

@ -1,14 +1,14 @@
package generator package generator
import ( import (
conf "github.com/tal-tech/go-zero/tools/goctl/config"
"github.com/tal-tech/go-zero/tools/goctl/util/format"
"path/filepath" "path/filepath"
"strings" "strings"
conf "github.com/tal-tech/go-zero/tools/goctl/config"
"github.com/tal-tech/go-zero/tools/goctl/rpc/parser" "github.com/tal-tech/go-zero/tools/goctl/rpc/parser"
"github.com/tal-tech/go-zero/tools/goctl/util" "github.com/tal-tech/go-zero/tools/goctl/util"
"github.com/tal-tech/go-zero/tools/goctl/util/ctx" "github.com/tal-tech/go-zero/tools/goctl/util/ctx"
"github.com/tal-tech/go-zero/tools/goctl/util/format"
"github.com/tal-tech/go-zero/tools/goctl/util/stringx" "github.com/tal-tech/go-zero/tools/goctl/util/stringx"
) )
@ -61,7 +61,7 @@ func mkdir(ctx *ctx.ProjectContext, proto parser.Proto, cfg *conf.Config) (DirCo
serverDir := filepath.Join(internalDir, "server") serverDir := filepath.Join(internalDir, "server")
svcDir := filepath.Join(internalDir, "svc") svcDir := filepath.Join(internalDir, "svc")
pbDir := filepath.Join(ctx.WorkDir, proto.GoPackage) pbDir := filepath.Join(ctx.WorkDir, proto.GoPackage)
sName,err:=format.FileNamingFormat(cfg.NamingFormat,proto.Service.Name) sName, err := format.FileNamingFormat(cfg.NamingFormat, proto.Service.Name)
if err != nil { if err != nil {
return nil, err return nil, err
} }

Loading…
Cancel
Save