# 使用二进制形式发布go package

This release adds experimental, minimal support for building programs using binary-only packages, packages distributed in binary form without the corresponding source code. This feature is needed in some commercial settings but is not intended to be fully integrated into the rest of the toolchain. For example, tools that assume access to complete source code will not work with such packages, and there are no plans to support such packages in the “go get” command.

Package build文档中也有相关的介绍：

It is possible to distribute packages in binary form without including the source code used for compiling the package. To do this, the package must be distributed with a source file not excluded by build constraints and containing a "//go:binary-only-package" comment. Like a build constraint, this comment must appear near the top of the file, preceded only by blank lines and other line comments and with a blank line following the comment, to separate it from the package documentation. Unlike build constraints, this comment is only recognized in non-test Go source files.

The minimal source code for a binary-only package is therefore:

The source code may include additional Go code. That code is never compiled but will be processed by tools like godoc and might be useful as end-user documentation.

golang binary-only packages也能搜到一些相关的教程，有人还写了一个样板例子：tcnksm/go-binary-only-package