I am trying to write a script in Go but I get this error:
bad interpreter: Permission denied
My super simple script is as follow:
#!/usr/local/Cellar/go/1.0.2/bin
fmt.Println("Hello World")
I don´t know if this is possible but I would really like to write scripts in Go since I like the language a lot.
Go isn’t a scripting language. Like in C you have to compile your source code to make an executable.
From the “Getting Started” :
In the spirit of Python, there are attempts to make Go scripts kinda possible. Here’s for example what you can do with gorun :
But that’s not really the logic of Go and that’s not nearly as simple as what you typed in your question.