Python 대신 Go로 스크립팅하기
------------------------------
- Go 파일을 *실행 파일처럼 직접 실행* 할 수 있는 트릭 소개
- 첫 줄에 //usr/local/go/bin/go run "$0" "$@"; exit를 두고 실행 권한을 주면 ./script.go로 실행 가능
- 이 방식은 shebang이 아니라 *POSIX에서 ENOEXEC 발생 시 셸이 /bin/sh로 폴백하는 동작* 을 이용함
- 셸은 첫 줄을 명령으로 실행하…
------------------------------
https://news.hada.io/topic?id=25455&utm_source=googlechat&utm_medium=bot&utm_campaign=1834
If you have a fediverse account, you can quote this note from your own instance. Search https://sns.lemondouble.com/notes/agwzf7r5c1 on your instance and quote it. (Note that quoting is not supported in Mastodon.)