What's the appropriate Go shebang line?

后端 未结 6 768
情书的邮戳
情书的邮戳 2021-02-01 01:55

I like using shebangs to run my Perl scripts directly:

#!/usr/bin/env perl

What\'s the shebang for Go programs?

6条回答
  •  长情又很酷
    2021-02-01 02:17

    There isn't one by default. There is a third-party tool called gorun that will allow you to do it, though. https://wiki.ubuntu.com/gorun

    Unfortunately the compilers don't like the shebang line. You can't compile the same code you run with gorun.

提交回复
热议问题