bingo
Bingo is a command-line utility making Go source files from the given binary. It is
like go.rice
, go-bindata
, go-embed
and other awesome tools.
But the bingo
is much more simple. It just gets a single file and makes a single .go source with a single []byte variable.
That is all. No additional functionality.
For example, the echo 'Lorem ipsum' | bingo -var Lorem
will produce:
// Code generated by bingo. DO NOT EDIT.
package main
var Lorem = []byte("\x4c\x6f\x72\x65\x6d\x20\x69\x70\x73\x75\x6d\x0a")
Bingo can be used with go generate
as:
//go:generate bingo -in mybinfile.bin -out mybinfile.go -pkg mypack -var BinData
CLI flags of bingo
Usage of bingo:
-help
Show help
-in string
Input file or stdin if empty
-out string
Output file or stdout if empty
-pkg string
Package name (default "main")
-var string
Variable name (default "foo")