web项目资源文件打包进二进制中 https://github.com/go-bindata/go-bindata
fish be2e3b2bab 0 | 2 months ago | |
---|---|---|
assets | 2 months ago | |
.gitignore | 2 months ago | |
README.md | 2 months ago | |
bindata.go | 2 months ago | |
go.mod | 2 months ago | |
go.sum | 2 months ago | |
main.go | 2 months ago |
web项目资源文件打包进二进制中
go mod init my-go-project
go get github.com/gin-gonic/gin
export PATH=$PATH:$(go env GOPATH)/bin
GOPROXY=https://mirrors.aliyun.com/goproxy/,direct;GO111MODULE=auto
GOPROXY=https://goproxy.cn,direct;GO111MODULE=auto
go get -u github.com/go-bindata/go-bindata/...
静态打包
go-bindata-assetfs -o=vue/vue.go -pkg=vue vue/dist/...
go-bindata -o bindata.go -pkg main assets/...
go build
go run main.go bindata.go