dpcnm2132 2015-03-01 10:23
浏览 92
已采纳

安装Go脚本以从Shell运行

I have a go script named SSL_CHECK.go. Now to run it I need to run it as go run SSL_CHECK.go <<optiional arguments>>

I want to compile this script so that I can execute it as a shell command.

For instance like ./ssl_check <<optional arguments>> from the shell.

Can I achieve that in Go.

  • 写回答

1条回答 默认 最新

  • duanaoreng9355 2015-03-01 11:33
    关注

    If you SSL_CHECK.go is in the package main, all you need to do is go install (as in "Compile and install packages and dependencies").

    That will generate a SSH_CHECK executable and put it in your $GOPATH/bin folder, which should be referenced in your $PATH.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?