web项目资源文件打包进二进制中 https://github.com/go-bindata/go-bindata
天问 9d08e2c15c Update 'README.md' | 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 get github.com/elazarl/go-bindata-assetfs/...
静态打包
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