We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go version
$ go version go version go1.13.9 darwin/amd64
not tested
go env
$ go env GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/Users/username/Library/Caches/go-build" GOENV="/Users/username/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GONOPROXY="git.in.xxx.com" GONOSUMDB="git.in.xxx.com" GOOS="darwin" GOPATH="/Users/username/go" GOPRIVATE="git.in.xxx.com" GOPROXY="https://goproxy.in.xxx.com,direct" GOROOT="/usr/local/Cellar/go@1.13/1.13.9/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go@1.13/1.13.9/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/username/go/src/git.in.xxx.com/data/projectname/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/j0/j6p5rq894ysfxdscvqm4qfzh0000gn/T/go-build516394362=/tmp/go-build -gno-record-gcc-switches -fno-common"
format generated thrift file
before format
switch cmd { case "batch_get": if flag.NArg()-1 != 1 { fmt.Fprintln(os.Stderr, "BatchGet requires 1 args") flag.Usage() } arg8 := flag.Arg(1) mbTrans9 := thrift.NewTMemoryBufferLen(len(arg8)) defer mbTrans9.Close() _, err10 := mbTrans9.WriteString(arg8) if err10 != nil { Usage() return } factory11 := thrift.NewTSimpleJSONProtocolFactory() jsProt12 := factory11.GetProtocol(mbTrans9) argvalue0 := media_profile_2_thrift.NewBatchGetParam() err13 := argvalue0.Read(jsProt12) if err13 != nil { Usage() return } value0 := argvalue0 fmt.Print(client.BatchGet(context.Background(), value0)) fmt.Print("\n") break case "": Usage() break default: fmt.Fprintln(os.Stderr, "Invalid function ", cmd) }
format with cmd
$ goimports -w -local -v -l filename
after format
switch cmd { case "batch_get": if flag.NArg()-1 != 1 { fmt.Fprintln(os.Stderr, "BatchGet requires 1 args") flag.Usage() } arg9 := flag.Arg(1) mbTrans10 := thrift.NewTMemoryBufferLen(len(arg9)) defer mbTrans10.Close() _, err11 := mbTrans10.WriteString(arg9) if err11 != nil { Usage() return } factory12 := thrift.NewTSimpleJSONProtocolFactory() jsProt13 := factory12.GetProtocol(mbTrans10) argvalue0 := media_profile_2_thrift.NewBatchGetParam() err14 := argvalue0.Read(jsProt13) if err14 != nil { Usage() return } value0 := argvalue0 fmt.Print(client.BatchGet(context.Background(), value0)) fmt.Print("\n") break case "": Usage() break default: fmt.Fprintln(os.Stderr, "Invalid function ", cmd) }
do not rename, just leave the variable name along
see, arg8, mbTrans9, err10, factory11, jsProt12, err13 was renamed to arg9, mbTrans10, err11, factory12, jsProt13, err14 respectively
arg8
mbTrans9
err10
factory11
jsProt12
err13
arg9
mbTrans10
err11
factory12
jsProt13
err14
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
not tested
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
format generated thrift file
before format
Outputformat with cmd
after format
after format
OutputWhat did you expect to see?
do not rename, just leave the variable name along
What did you see instead?
see,
arg8
,mbTrans9
,err10
,factory11
,jsProt12
,err13
was renamed toarg9
,mbTrans10
,err11
,factory12
,jsProt13
,err14
respectivelyThe text was updated successfully, but these errors were encountered: