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

"skip file since no import" output breaks use-case of outputting to stdout #42

Closed
danxmoran opened this issue Nov 11, 2021 · 1 comment

Comments

@danxmoran
Copy link
Contributor

After #41 merges I was hoping to be able to use gci as part of a chain of formatting tools, roughly:

gofmt main.go | gci > main.formatted.go

This use-case doesn't work for files with no imports, because gci prints "skip file main.go since no import" to stdout instead of the contents of the file.

It would be better if the "skip file" message was printed to stderr instead of stdout. If -w is passed the tool can still bail out early, but if -w is missing then the file contents should still be printed to stdout.

@daixiang0
Copy link
Owner

Fixed.

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

2 participants