The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
funky

go build windows 不带资源目录

  •  
  •   funky · Apr 28, 2020 · 2762 views
    This topic created in 2384 days ago, the information mentioned may be changed or developed.
    求解
    5 replies  •  2020-05-06 15:09:43 +08:00
    funky
    funky
    OP
    Apr 28, 2020
    1
    就是打出来的 exe 可以带资源目录
    killerirving
    killerirving
    Apr 28, 2020
    2
    资源目录本来就不会打包进去,这种需求看看 go-bindata 类似的项目
    sunshinev
    sunshinev
    May 6, 2020
    4
    按照 @killerirving 说的,使用 go-bindata 来做吧,非常好用,https://github.com/sunshinev/go-sword 我的这个项目就是使用了 go-bindata 来进行了静态资源打包
    sunshinev
    sunshinev
    May 6, 2020
    5
    go 是编译行语言,在 build 的时候,只会将相关用到的资源打包。但是很多资源是启动 http 服务之后,通过请求来解析的本地静态资源。比如 css 、js 、html 模板等,这些会根据路由来匹配不同的文件。所以需要进行 go-bindata 打包成 go 文件
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   712 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 19:52 · PVG 03:52 · LAX 11:52 · JFK 14:52
    ♥ Do have faith in what you're doing.