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

Support all stdlib packages (Fix: Infinite repair loop) #174

Closed
mvrahden opened this issue Sep 21, 2023 · 5 comments
Closed

Support all stdlib packages (Fix: Infinite repair loop) #174

mvrahden opened this issue Sep 21, 2023 · 5 comments

Comments

@mvrahden
Copy link

The gci fixes infinitely for newer stdlib packages. This original (No.1):

import (
	"context"
	"encoding/json"
	"errors"
	"slices" // <<---
	"testing"

	"github.com/aws/aws-lambda-go/events"
	"github.com/stretchr/testify/require"
)

becomes (No.2):

import (
	"context"
	"encoding/json"
	"errors"
	"testing"

	"github.com/aws/aws-lambda-go/events"
	"github.com/stretchr/testify/require"
	"slices" // <<---
)

becomes (No.3):

import (
	"context"
	"encoding/json"
	"errors"
	"testing"

	"slices" // <<---

	"github.com/aws/aws-lambda-go/events"
	"github.com/stretchr/testify/require"
)

and then becomes No.2 again, and will then never stop fixing. This is problematic in golangci-lint.

Can this please be fixed?

@mvrahden mvrahden changed the title Support all stdlib packages Support all stdlib packages (Fix: Infinite repair loop) Sep 21, 2023
@daixiang0
Copy link
Owner

Could you provide the issue version of GCI?

@mvrahden
Copy link
Author

Hi, it is version v0.11.0 of GCI. I was using it in combination with golangci-lint v1.54.2.

@andriisoldatenko
Copy link

Looks like it fixed in #174 https://github.com/daixiang0/gci/pull/163/files#diff-74342d74a10a1ff588f6ae1b4e02e5869a759bcdad74b2f41756252ef024b72eR146

I've tested with golang 1.21.4 and gci version 0.11.2 and it works like a charm.

@daixiang0
Copy link
Owner

Close as fixed.

@ccoVeille
Copy link
Contributor

ccoVeille commented Mar 12, 2024

Looks like it fixed in #174 https://github.com/daixiang0/gci/pull/163/files#diff-74342d74a10a1ff588f6ae1b4e02e5869a759bcdad74b2f41756252ef024b72eR146

I've tested with golang 1.21.4 and gci version 0.11.2 and it works like a charm.

I think you meant #163 because #174 is this one.

But it's a great thing. Thanks for spotting it was fixed. I was following this ticket and not 163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants