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

GCI fails to parse imports that are not in an import block #121

Closed
benmathews opened this issue Nov 15, 2022 · 3 comments
Closed

GCI fails to parse imports that are not in an import block #121

benmathews opened this issue Nov 15, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@benmathews
Copy link

benmathews commented Nov 15, 2022

What version of GCI are you using?

gci version 0.8.2

Reproduce Steps

Running gci against the attached file with imports individually specified.

❯ gci write bad.go 
Error: 12:148: expected ')', found 'EOF'

Reformat the import lines and gci is able to parse the file.
good.go

➜ diff bad.go good.go 
3,5c3,7
< import _ "source.vivint.com/pl/messagetypes/objectid"
< import _ "source.vivint.com/pl/messagetypes/time"
< import _ "source.vivint.com/pl/messagetypes/nullable"
---
> import (
> 	_ "source.vivint.com/pl/messagetypes/nullable"
> 	_ "source.vivint.com/pl/messagetypes/objectid"
> 	_ "source.vivint.com/pl/messagetypes/time"
> )
@daixiang0 daixiang0 added the bug Something isn't working label Nov 16, 2022
@daixiang0
Copy link
Owner

You can use master HEAD to fix this issue.

@daixiang0
Copy link
Owner

Fixed by #120

@benmathews
Copy link
Author

Sorry for the duplicate ticket. I reviewed open tickets, but not closed ones. Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants