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.

Release notes: Snapcraft 3.4
Supported plugins
Snapcraft build, debug and publishing docs roadmap (page breakdown)
Snap documentation

go-channel doesn’t work.

Failed to load plugin: properties failed to load: Additional properties are not allowed (‘go-channel’ was unexpected)


Hello - could you provide a few more details, or a paste of your snapcraft.yaml? For reference, the following snapcraft.yaml with go-channel is working for me:

name: grv
summary: view and manipulate Git repositories from the command line
description: |
     GRV is a terminal based interface for viewing Git repositories. It
     allows refs, commits and diffs to be viewed, searched and filtered.
     The behaviour and style can be customised through configuration. A query
     language can be used to filter refs and commits, see the Documentation
     section for more information.
adopt-info: grv
grade: stable
base: core18

confinement: strict

    command: bin/grv
      - home
      - network
    plugin: cmake
    source-type: git
        - libssl-dev
        - libssh-dev
        - libncursesw5-dev
    plugin: go
    go-channel: 1.11/stable
      - libgit2
    source-type: git
    override-pull: |
      snapcraftctl pull
      snapcraftctl set-version \
      "$(git describe --long --tags --always --match=v*.*.* | sed 's/v//')"
    override-build: |
      export GOPATH=$(dirname $SNAPCRAFT_PART_INSTALL)/go
      go get -d
      cd $GOPATH/src/
      make install
      mkdir -p $SNAPCRAFT_PART_INSTALL/bin/
      mv grv $SNAPCRAFT_PART_INSTALL/bin/
      - pkg-config
      - libreadline-dev
      - libncurses5-dev
      - git


I’ve commented lines that caused issues.

name: permaweb-host
#title: Permaweb Host
base: core18
version: git
summary: Throws a Git repo to IPNS
description: |
  Permaweb Host exposes a web interface and an API to add Git repos to IPNS.
  This interface is not protected. Ideally, if you want to sell its services,
  you should create your own web interface with user authentication and a payment gateway.
type: app
confinement: devmode
#license: MIT
grade: devel
      - git
      - gcc
      - go/stable
#      - ipfs/edge
      - node/12/stable
    override-build: |
      sudo npm install --global hogan.js
      npx hulk ./web/mustache/*.html --outputdir ./web/templates/
      go get -u
      ~/go/bin/rice embed-go
      snapcraftctl build
    source: .
    source-type: git
#    stage-snaps:
#      - ipfs/edge
#      - ipfs-cluster/edge
    plugin: go
#    go-channel: stable
#    go-importpath:

I also created a separate topic.

I’ve encountered so many unexpected problems so far, I’m sorry if I’m a bit salty. I’ll do my best.

It also seems like I’m not the only one to have this problem.


In my case what solved all my problems, was installing snapcraft via snap, because for some stupid reason, the ubuntu repositories had an ages old version of snapcraft that didn’t align with the documentation.

Additional properties are not allowed ('go-channel' was unexpected)
Can't use the go piugin and specify a go-channel

Ah, dammit. I had both installed.


The go plugin doesn’t work with relative source paths. The snapcraft.yaml located in ./contrib/snapcraft/snap/snapcraft.yaml was modified to use parent sources, and started to fail.


The failure with source: ../...

Pulling podman import "" is a program, not an importable package import "" is a program, not an importable package
go get -t -d ./
Failed to run 'go get -t -d ./' for 'podman': Exited with code 1.
Verify that the part is using the correct parameters and try again.
Exit status: 2

The failure with source: ../../.. is slightly more verbose, and doesn’t work too.

Pulling podman 
package /var/tmp/go/src/ exists but /var/tmp/go/src/ does not - stale checkout?
package cannot find package "" in any of: