command
module
Version:
v1.0.3
Opens a new window with list of versions in this module.
Published: May 11, 2021
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Resource Package Generator for Golang
Very simple generator used to embed some file into executable. Useful to store template files.
go get github.com/Axili39/res2go
go build
go install
usage:
Usage of ./res2go:
-o string
output file (default "resources.go")
-package string
package name (default "resources")
-prefix string
add prefix to all exported function
examples:
res2go ./resources
res2go ./templates/index.html ./templates/style.js
res2go -package myresources index.html
res2go -package myresources -o rsrc/rsrc.go resources/*.templates
res2go -package main -o rsrc.go -prefix Rsrc resources/*
Example in Go code:
//go:generate res2go -package resources -o resources/resources.go resources/*.templates
import (
"./resources"
)
func main() {
resources.Init()
myfile = resources.Files["resources/example.template"]
fmt.Println(string(myfile))
}
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.