web项目资源文件打包进二进制中 https://github.com/go-bindata/go-bindata

天问 9d08e2c15c Update 'README.md' 2 months ago
assets be2e3b2bab 0 2 months ago
.gitignore be2e3b2bab 0 2 months ago
README.md 9d08e2c15c Update 'README.md' 2 months ago
bindata.go be2e3b2bab 0 2 months ago
go.mod be2e3b2bab 0 2 months ago
go.sum be2e3b2bab 0 2 months ago
main.go be2e3b2bab 0 2 months ago

README.md

go-bindata

web项目资源文件打包进二进制中

Develop

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

License

Reference