Please answer these questions before submitting your issue. Thanks!
-
What version of Go are you using (go version)?
go version go1.6 darwin/amd
-
What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hiro/.go"
GORACE=""
GOROOT="/Users/hiro/go1.6"
GOTOOLDIR="/Users/hiro/go1.6/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
-
What did you do?
I was trying to preallocate buffer for encoding.
After I ran gofmt, I expected comments in expr-stmt are arranged, but not.
package main
func main() {
var val []byte
var name string
buf := make([]byte, 24+ // min buffer size
4+len(val)+ // tagLen + value
2+len(name)+1+ // nameLen + name + '\0'
16) // checksum
_ = buf
}
https://play.golang.org/p/wAVUh_sGmw
-
What did you expect to see?
package main
func main() {
var val []byte
var name string
buf := make([]byte, 24+ // min buffer size
4+len(val)+ // tagLen + value
2+len(name)+1+ // nameLen + name + '\0'
16) // checksum
_ = buf
}
-
What did you see instead?
same as input.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version)?go version go1.6 darwin/amd
What operating system and processor architecture are you using (
go env)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hiro/.go"
GORACE=""
GOROOT="/Users/hiro/go1.6"
GOTOOLDIR="/Users/hiro/go1.6/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
What did you do?
I was trying to preallocate buffer for encoding.
After I ran
gofmt, I expected comments in expr-stmt are arranged, but not.https://play.golang.org/p/wAVUh_sGmw
What did you expect to see?
What did you see instead?
same as input.