-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.
Milestone
Description
What version of Go are you using (go version)?
$ go version go version go1.13.9 darwin/amd64
Does this issue reproduce with the latest release?
not tested
What operating system and processor architecture are you using (go env)?
go env Output
$ 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"
What did you do?
format generated thrift file
before format Output
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
after format Output
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)
}
What 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 to arg9, mbTrans10, err11, factory12, jsProt13, err14 respectively
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeToolsThis label describes issues relating to any tools in the x/tools repository.This label describes issues relating to any tools in the x/tools repository.