Comments (3)
should use /
as path sep instead of \
just match same issue...
from go-bindata.
should use
/
as path sep instead of\
just match same issue...
是 web/..
. 生效了,但是 assets/...
没生效
from go-bindata.
我通过这样的以下方式兼容了。但是这个问题仍然是存在的。
- 打包命令去掉
--prefix
go-bindata -fs -pkg=assets -o=internal/assets/bindata.go -ignore=\\.DS_Store web/... assets/...
- 添加拦截器处理请求的URL
// 静态页面(路径范围越大的要放在越后面)
router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// 解决 go-bindata 在 windows 下打包多个目录,使用 -prefix 参数生成的文件编译报错
r.URL, _ = url.Parse("/web" + r.URL.EscapedPath())
http.FileServer(assets.AssetFile()).ServeHTTP(w, r)
})
http.Handle("/", router)
from go-bindata.
Related Issues (20)
- `-prefix` still shows prefix in comments HOT 1
- -debug generates wrong output (bindataFileInfo struct is missing) HOT 7
- zsh: command not found: go-bindata HOT 4
- 404 when hosting using `-fs` and hosting over `net/http` HOT 5
- checksum mismatch HOT 1
- Can I use this package to generate binary code for all my methods in one package and call the methods through bindata.go HOT 1
- Not reading subdirectories
- Execute binary in memory HOT 1
- binary releases ? HOT 1
- bindataFileInfo not defined when using -debug HOT 1
- Feature: add ability to completely clean embedded binary content at run time HOT 1
- centos build arm run error HOT 1
- web edit
- installation instruction not working with go1.17.1 HOT 4
- 你好,windows 10下运行报错 HOT 1
- go-staticcheck linter warnings in generated code HOT 1
- Error: no migration found
- Q: How to unpack a bindata.go file? HOT 1
- go-bindata command not working HOT 3
- Unreasonable scan results HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-bindata.