The go plugin

The go plugin can be used by Go projects using go get, the command used to grab a project’s dependencies.

This plugin uses the common plugin keywords as well as those for “sources”. For more information, see Snapcraft parts metadata.

Additionally, this plugin uses the following plugin-specific keywords:

  • go-channel (string, default: latest/stable)
    The snap Store channel to install go from. If set to an empty string, go will be installed using the system’s traditional package manager.

  • go-packages (list of strings)
    Go packages to fetch, these must be a “main” package.
    Dependencies are pulled in automatically by go get.
    Packages that are not “main” will not cause an error, but would not be useful either.
    If the package is a part of the go-importpath the local package
    corresponding to those sources will be used

  • go-importpath (string)
    This entry tells the checked out source to live within a certain path
    within GOPATH.
    This is not needed and does not affect go-packages.

  • go-buildtags (list of strings)
    Tags to use during the go build. Default is not to use any build tags.

See Go applications for a simple example, or search GitHub for projects already using the plugin.

This is a snapcraft plugin. See Snapcraft plugins and Supported plugins for further details on how plugins are used.

Last updated 1 year, 4 months ago. Help improve this document in the forum.