Skip to content

Instantly share code, notes, and snippets.

@marekfilip
Last active April 10, 2019 09:37
Show Gist options
  • Select an option

  • Save marekfilip/37b555b3f35d482dc96763f489f461ea to your computer and use it in GitHub Desktop.

Select an option

Save marekfilip/37b555b3f35d482dc96763f489f461ea to your computer and use it in GitHub Desktop.
Golang as script interpreter

Adding interpreter

  1. To register interpreter you need to install gorun.

  2. Then register interpreter to binfmt_misc, remember to change path to gorun (more about binfmt_misc)

    echo ':golang:E::go::/home/filip/go/bin/gorun:OC' | sudo tee /proc/sys/fs/binfmt_misc/register

Removing interpreter

To remove interpreter simply echo -1 to it

echo '-1' | sudo tee /proc/sys/fs/binfmt_misc/golang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment