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 · 2 comments
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@QianChenglong
Copy link

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 the Tools This label describes issues relating to any tools in the x/tools repository. label Dec 15, 2020
@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
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Dec 21, 2020
@andyxning
Copy link

Any clue for this issue?

@ImprintNav
Copy link

Two and a half years later and still not even looked into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

5 participants