Skip to content

Instantly share code, notes, and snippets.

@lambrospetrou
Last active March 11, 2018 15:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambrospetrou/791aae8bd148f34c5290b541eced0583 to your computer and use it in GitHub Desktop.
Save lambrospetrou/791aae8bd148f34c5290b541eced0583 to your computer and use it in GitHub Desktop.
Shebang for Go scripts
// 2>/dev/null;/usr/bin/env go run $0 $@; exit $?
// Found at https://gist.github.com/posener/73ffd326d88483df6b1cb66e8ed1e0bd
package main
import "fmt"
// You can run the script with one of two ways
// 1. chmod +x test-script.go && ./test-script.go
// 2. go run test-script.go
func main() {
fmt.Println("vim-go")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment