Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
一个把资源文件变成 go 语言变量的小工具
社区开发
488
views ·
2
replies ·
To
floor
Go
梦幻大陆
deepin
2018-11-23 03:41
Author
本来是我自己编来自己用的小工具。
名称:gores
把一个文件的内容变成一个 go 语言的变量的小工具。
使用说明:
gores -name varName -f inputfile -pkg packageName
参数说明:
gores -h
Usage of gores:
-f string 输入文件(input file pathname)
-name string 变量名称(variable name)
-pkg string package 名称(package name),默认值:main (default "main")
效果: 把 'inputfile' 的内容变成变量 'varName' 的值,类型: []byte
生成: varNameRes.go
安装(纯粹使用标准库,没有依赖关系,只要有go就好)
go get gitee.com/rocket049/gores
或者:
go get github.com/rocket049/gores
编译好的程序在 GOPATH/bin/ 下面,默认 GOPATH="$HOME/go"
Reply
Like 0
Favorite
View the author
All Replies
许自强
deepin
2018-12-10 02:07
#1
这个有什么用啊
Reply
Like 0
View the author
梦幻大陆
deepin
2018-12-10 05:38
#2
例如使用GtkBuilder读取xml格式窗口描述文件,就会产生对一个xml文件的依赖,这个工具可以把这个窗口描述文件变成一个变量,编译后的程序就不需要依赖窗口描述文件。
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
Update driver for my computer
Copying folder - Not enough disk space?
Popular Events
More
名称:gores
把一个文件的内容变成一个 go 语言的变量的小工具。
使用说明:
gores -name varName -f inputfile -pkg packageName
参数说明:
gores -h
Usage of gores:
-f string 输入文件(input file pathname)
-name string 变量名称(variable name)
-pkg string package 名称(package name),默认值:main (default "main")
效果: 把 'inputfile' 的内容变成变量 'varName' 的值,类型: []byte
生成: varNameRes.go
安装(纯粹使用标准库,没有依赖关系,只要有go就好)
go get gitee.com/rocket049/gores
或者:
go get github.com/rocket049/gores
编译好的程序在 GOPATH/bin/ 下面,默认 GOPATH="$HOME/go"