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: goimports destroys import groups #28355

Closed
gbbr opened this issue Oct 24, 2018 · 3 comments
Closed

x/tools/cmd/goimports: goimports destroys import groups #28355

gbbr opened this issue Oct 24, 2018 · 3 comments
Milestone

Comments

@gbbr
Copy link
Member

@gbbr gbbr commented Oct 24, 2018

There have been some rather unusual changes to goimports lately. Is this what is expected here?

Before running goimports:

import (
	"context"
	"fmt"
	"io"
	"net"
	"testing"
	"time"

	"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext"
	"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/mocktracer"
	"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"

	"github.com/mongodb/mongo-go-driver/bson"
	"github.com/mongodb/mongo-go-driver/core/result"
	"github.com/mongodb/mongo-go-driver/core/wiremessage"
	"github.com/mongodb/mongo-go-driver/mongo"
	"github.com/mongodb/mongo-go-driver/mongo/clientopt"

	"github.com/stretchr/testify/assert"
)

After:

import (
	"context"
	"fmt"
	"io"
	"net"
	"testing"
	"time"

	"github.com/mongodb/mongo-go-driver/bson"
	"github.com/mongodb/mongo-go-driver/core/result"
	"github.com/mongodb/mongo-go-driver/core/wiremessage"
	"github.com/mongodb/mongo-go-driver/mongo"
	"github.com/mongodb/mongo-go-driver/mongo/clientopt"
	"github.com/stretchr/testify/assert"
	"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/ext"
	"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/mocktracer"
	"gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)

Is this really what we want? Isn't it better to allow separating standard library, same package and external? This gets even worse for larger projects.

I'd like to propose keeping space separated groups, just like before.

@gopherbot gopherbot added this to the Unreleased milestone Oct 24, 2018
@hyangah
Copy link
Contributor

@hyangah hyangah commented Oct 24, 2018

Is this a result of the recent commit for #20818?

@agnivade
Copy link
Contributor

@agnivade agnivade commented Oct 24, 2018

@gbbr - @bradfitz just reverted the change for #20818. Could you get the latest and check again ?

@gbbr
Copy link
Member Author

@gbbr gbbr commented Oct 25, 2018

Yep, fixed. Thanks.

@gbbr gbbr closed this Oct 25, 2018
@golang golang locked and limited conversation to collaborators Oct 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.