官术网_书友最值得收藏!

  • Security with Go
  • John Daniel Leon
  • 92字
  • 2021-06-30 19:06:42

Building the executable file

To compile and build an executable file, use the go build command. When running go build you must pass a path to a package. The package path you provide is relative to $GOPATH/src. Since our package is in ~/src/hello, we would run the command as follows:

go build hello

We can actually call go build from anywhere as long as we have a $GOPATH set. The executable binary that is created will be output in the current working directory. You can then run it with this command:

./hello
主站蜘蛛池模板: 营山县| 咸宁市| 电白县| 开阳县| 沁阳市| 桐乡市| 类乌齐县| 乐昌市| 绍兴市| 远安县| 赤水市| 徐水县| 张家港市| 邵东县| 弥勒县| 苏尼特左旗| 潞城市| 尤溪县| 突泉县| 云梦县| 廉江市| 揭东县| 封开县| 大新县| 彝良县| 揭阳市| 建水县| 驻马店市| 旺苍县| 大悟县| 洮南市| 宁河县| 麻江县| 广丰县| 灯塔市| 那曲县| 云浮市| 紫阳县| 山东省| 蒲城县| 正镶白旗|