Skip to content
New issue

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

x/tools/cmd/goimports: adds flag control to delete extra blank lines before grouping #43193

Open
QianChenglong opened this issue Dec 15, 2020 · 0 comments

Comments

@QianChenglong
Copy link

@QianChenglong QianChenglong commented Dec 15, 2020

What version of Go are you using (go version)?

$ go version
go version go1.15.2 darwin/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/chenglong/Library/Caches/go-build"
GOENV="/Users/chenglong/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/chenglong/go/pkg/mod"
GONOPROXY="tkestack.io,k8s.io,git.code.oa.com"
GONOSUMDB="tkestack.io,k8s.io,git.code.oa.com"
GOOS="darwin"
GOPATH="/Users/chenglong/go"
GOPRIVATE="tkestack.io,k8s.io,git.code.oa.com"
GOPROXY="https://goproxy.cn,direct"
GOROOT="/usr/local/Cellar/go/1.15.2/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15.2/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/20/n4jpmhjs0hd9hjxg80yr2nww0000gn/T/go-build993050189=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

use goimports to format file.

current:
image

What did you expect to see?

Blank lines cause incorrect grouping. These blank lines are automatically generated by IDE.

What did you see instead?

Delete extra blank lines and regroup:
image

@gopherbot gopherbot added this to the Unreleased milestone Dec 15, 2020
@cagedmantis cagedmantis changed the title x/tools/goimports adds flag control to delete extra blank lines before grouping x/tools/cmd/goimports: adds flag control to delete extra blank lines before grouping Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants