go 打包部署
2022年2月21日linux 平台打包
1 |
$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o goblog |
windows 平台打包
1 2 3 4 |
SET CGO_ENABLED=0 SET GOOS=linux SET GOARCH=amd64 go build -o goblog.exe |
打包静态文件
embed 打包 Go 静态文件
1 2 3 4 5 6 7 8 |
//go:embed resources/views/articles/* //go:embed resources/views/auth/* //go:embed resources/views/categories/* //go:embed resources/views/layouts/* var tplFS embed.FS //go:embed public/* var staticFS embed.FS |