Documentation ¶
Overview ¶
Bundle combines all source files for a given package into a single source file, optionally adding a prefix to all top-level names.
Usage:
bundle [-p pkgname] [-x prefix] importpath >file.go
Example ¶
The Go 1.3 cmd/objdump embeds the code for rsc.io/x86/x86asm. Its Makefile builds x86.go using:
bundle -p main -x x86_ rsc.io/x86/x86asm >x86.go
Bugs ¶
Bundle has many limitations, most of them not fundamental.
It does not work with cgo.
It does not work with renamed imports.
It does not correctly translate struct literals when prefixing is enabled and a field key in the literal key is the same as a top-level name.
It does not work with embedded struct fields.
Click to show internal directories.
Click to hide internal directories.