7 ms·
The following would probably be more portable: ///usr/bin/env go run "$0" "$@"; exit Note, the exit code isn't passed through due to: https://github.com/g
by emersion 9mo ago
The following would probably be more portable:
///usr/bin/env go run "$0" "$@"; exit
Note, the exit code isn't passed through due to:
https://github.com/golang/go/issues/13440 https://github.com/golang/go/issues/13440
- incognito124 9mo agoTo quote the blog in question: > How true this is, is a topic I dare not enter.
- loosescrews 9mo agoThe blog says that in regard to finding bash with env. My reading is that it does not make the same claim regarding finding go with env. bash is commonly found at /bin/bash (or a symlink there exists) as it is widely used in scripts and being available at that path is a well known requirement for compatibility. Go does not so much have a conical path and I have personally installed it at a variety of paths over the years (with the majority working with env). While I agree with the author of the blog that using env to find bash may or may not improve compatibility, I also agree with the parent comment that using env to find go probably does improve compatibility.
- zahlman 9mo agoDoes the third leading slash do something?
- emersion 9mo agoNo, it just felt a tad cleaner to have the comment slashes separate from the path leading slash.