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: Feature Request --> coalesce import groups #35879

Closed
nmiculinic opened this issue Nov 27, 2019 · 1 comment
Closed

x/tools/cmd/goimports: Feature Request --> coalesce import groups #35879

nmiculinic opened this issue Nov 27, 2019 · 1 comment
Labels
Milestone

Comments

@nmiculinic
Copy link

@nmiculinic nmiculinic commented Nov 27, 2019

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

$ go version
go version go1.13.4 linux/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="/home/nmiculinic/.cache/go-build"
GOENV="/home/nmiculinic/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/nmiculinic/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/nmiculinic/Desktop/kubecarrier/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build238528765=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I have the following file:

package framework

import (
	"bytes"
	"fmt"
	"os"
	"os/exec"
	"strings"
	"testing"

	aaa "local"

	"github.com/stretchr/testify/require"

	"k8s.io/apimachinery/pkg/runtime"
	clientgoscheme "k8s.io/client-go/kubernetes/scheme"
	restclient "k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"
	"sigs.k8s.io/controller-runtime/pkg/client"

	ggg "local/ddd"
	zzz "local/zzz"
)

And after running goimports -local local -w <filename>.go it doesn't sort the import properly. I'd expect some input group coalescing:

What did you expect to see?

package framework

import (
	"bytes"
	"fmt"
	"os"
	"os/exec"
	"strings"
	"testing"

	"github.com/stretchr/testify/require"
	"k8s.io/apimachinery/pkg/runtime"
	clientgoscheme "k8s.io/client-go/kubernetes/scheme"
	restclient "k8s.io/client-go/rest"
	"k8s.io/client-go/tools/clientcmd"
	"sigs.k8s.io/controller-runtime/pkg/client"

	aaa "local"
	ggg "local/ddd"
	zzz "local/zzz"
)

What did you see instead?

It remained the same.

I've tried fixing it; and making a PR....but got bunch of failing tests without really understanding why or what is happening:

0001-Trying-to-add-this-feature.txt

@gopherbot gopherbot added this to the Unreleased milestone Nov 27, 2019
@gopherbot gopherbot added the Tools label Nov 27, 2019
@nmiculinic nmiculinic mentioned this issue Nov 27, 2019
3 of 4 tasks complete
@heschik
Copy link
Contributor

@heschik heschik commented Nov 27, 2019

We can't look at patches in issues, sorry.

Closing as a dupe of #20818. Please comment if you disagree.

@heschik heschik closed this Nov 27, 2019
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
You can’t perform that action at this time.