You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a go file in our project that is meant to be run on the command line. We added a shebang line at the top to make it self-running, as per this blog
The problem is gofumpt converts //usr/bin/env go run to // usr/bin/env go run which makes it unrunnable from command-line
Is there a way we can ignore any lines that begin with //usr/bin/env go run or maybe exclude that file from formatting?
The text was updated successfully, but these errors were encountered:
Hm, I wasn't aware that people were actually doing this :)
I guess we can treat a comment on the first line as code (and so leave it alone) if it looks like a shebang, e.g. if it contains the string bin/. Do you reckon that would be enough?
Another way to deal with it would be to look for files that have execute permissions and their first line ends with the string go run or use some regular expression that accepts some obvious constructs.
We have a go file in our project that is meant to be run on the command line. We added a shebang line at the top to make it self-running, as per this blog
The problem is gofumpt converts
//usr/bin/env go run
to// usr/bin/env go run
which makes it unrunnable from command-lineIs there a way we can ignore any lines that begin with
//usr/bin/env go run
or maybe exclude that file from formatting?The text was updated successfully, but these errors were encountered: