The mkmerge command parses generated source files and merges common consts, funcs, and types into a common source file, per GOOS.
$ mkmerge -out MERGED FILE [FILE ...]
# Remove all common consts, funcs, and types from zerrors_linux_*.go # and write the common code into zerrors_linux.go $ mkmerge -out zerrors_linux.go zerrors_linux_*.go
mkmerge performs the merge in the following steps:
- Construct the set of common code that is identical in all architecture-specific files.
- Write this common code to the merged file.
- Remove the common code from all architecture-specific files.