We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
gci
gci version 0.11.0
1. Save following program to `main.go` 2. Run `gci diff main.go`
Note that it only happens when there is some additional (default) package present.
package main import ( "C" "fmt" _ "golang.org/x/example/hello/reverse" ) func init() { var x C.int fmt.Print(x) }
No diff.
--- main.go +++ main.go @@ -7,6 +7,12 @@ _ "golang.org/x/example/hello/reverse" ) +import ( + "fmt" + + _ "golang.org/x/example/hello/reverse" +) + func init() { var x C.int fmt.Print(x)
The text was updated successfully, but these errors were encountered:
As noted in the description, following program doesn't produce any diff:
package main import ( "C" "fmt" ) func init() { var x C.int fmt.Print(x) }
Sorry, something went wrong.
Because GCI consider it is a C block as a whole, need some time to think how to fix it.
For now, you should split C import as single.
@daixiang0 when i use the gci with https://golangci-lint.run/usage/linters/#gci, there is a error like: How do i need to configure it? Thanks a lot
https://golangci-lint.run/usage/linters/#gci
@SimFG I cannot reproduce it:
root:[gci]$ ./dist/gci diff -s standard -s default --custom-order gci-bug/main.go --- gci-bug/main.go +++ gci-bug/main.go @@ -1,7 +1,8 @@ package main import "C" + import ( - "sort" "fmt" + "sort" ) root:[gci]$ cat gci-bug/main.go package main import "C" import ( "sort" "fmt" )
thnaks a lot
No branches or pull requests
What version of GCI are you using?
Reproduce Steps
Note that it only happens when there is some additional (default) package present.
What did you expect to see?
No diff.
What did you see instead?
The text was updated successfully, but these errors were encountered: