16. Distributing Go Code

After you’ve written some Go code, there is a good chance that you are going to want other people to be able to use it. Because Go is statically compiled, you can distribute binary packages just as you would distribute code written in C, or any other statically compiled language.

1  $ otool -L 6.out2  6.out:3    /usr/lib/libSystem.B.dylib

Output from: otool

Programs compiled by Gc are statically linked, so you can just distribute the output from 6l without worrying about any other libraries. If you are distributing code—especially packages—in source form, then Go provides a few helper utilities to make your life a bit easier.

Installing Third-Party Packages

Get The Go Programming Language Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.