golang

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Binary

func Binary(dir, outfile string, flags ...string) (fab.Target, error)

Binary is a target describing how to compile a Go binary whose main package is in `dir`. The resulting binary gets written to `outfile`. If outfile is empty, it defaults to the last path element of dir. Additional command-line arguments for `go build` can be specified with `flags`.

Binary is implemented in terms of fab.Files, and the output file is automatically selected for "autocleaning." See fab.Autoclean for more about this feature.

A Binary target may be specified in YAML using the tag !go.Binary, which introduces a mapping whose fields are:

  • Dir: the directory containing the main Go package
  • Out: the output file that will contain the compiled binary,
  • Flags: a sequence of additional command-line flags for `go build`

Both Dir and Out are either absolute or relative to the directory containing the YAML file. If Out is unspecified, it defaults to the last path element of Dir.

func Deps

func Deps(dir string, recursive, tests bool) ([]string, error)

Deps produces the list of files involved in building the Go package in the given directory. It traverses package dependencies transitively, but only within the original package's module. The list is sorted for consistent, predictable results.

func MustBinary added in v0.42.0

func MustBinary(dir, outfile string, flags ...string) fab.Target

MustBinary is the same as Binary but panics on error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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