bundle

command
v0.0.0-...-b22f6f4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 11, 2016 License: BSD-3-Clause Imports: 15 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL