This is liable to change in the future.
A go_binary() rule builds a native executable from the supplied set of Go source files and dependencies. The files supplied are expected to be in the main package, implicitly.
Note: Buck is currently tested with (and therefore supports) version 1.10 of Go.
The name of the rule.
The set of source files to be compiled by this rule. .go files will be compiled with the Go compiler, .s files will be compiled with the assembler, and everything else is assumed to be files that may be
#included by the assembler.
The set of dependencies of this rule. Currently, this only supports go_library rules.
The cgo_library which gets compiled and linked as cgo extension.
The set of additional compiler flags to pass to
go tool compile.
The set of additional assembler flags to pass to
go tool asm.
Static files to be symlinked into the working directory of the test. You can access these in your by opening the files as relative paths, e.g.
List of build target patterns that identify the build rules that can include this rule as a dependency, for example, by listing it in their
exported_depsattributes. For more information, see visibility.
For more examples, check out our integration tests.
go_binary( name='greet', srcs=[ 'main.go', ], deps=[ ':greeting', ], ) go_library( name='greeting', srcs=[ 'greeting.go', ], deps=[ ':join', ], ) go_library( name='join', srcs=[ 'join.go', ], )