本地编译

前提:需要 Golang 环境提供编译,且版本要求:>= 1.16

默认编译为 linux 平台下的二进制文件,如需 windows 平台请使用 os=windows 进行指定。

# linux 平台
$ make exec
# windows 平台
$ make exec os=windows

Docker编译

  • 构建编译容器:
$ make pre-go
  • 编译生成二进制文件:
# linux 平台
$ make go
# windows 平台
$ make go os=windows
  • 删除容器:
$ make end-go

程序使用

例如:在 linux 平台下

  • 查看版本等信息

      $ ./assets/exec-v0.0.1-linux-x86_64 -v
    • 启动本地 web 服务,程序默认监听 12300 端口:
      $ ./assets/exec-v0.0.1-linux-x86_64
    • 也可手动指定监听端口:
      $ ./assets/exec-v0.0.1-linux-x86_64 -p 12300

    浏览器访问:http://localhost:12300

results matching ""

    No results matching ""