Skip to content

moonrepo/go-plugin

Repository files navigation

Go plugin

Go WASM plugin for proto.

Installation

proto install go

This plugin is built-in to proto, but if you want to override it with an explicit version, add the following to .prototools.

[plugins]
go = "source:https://github.com/moonrepo/go-plugin/releases/download/vX.Y.Z/go_plugin.wasm"

Configuration

Go plugin can be configured with a .prototools file.

  • dist-url (string) - The distribution URL to download Go archives from. Supports {version} and {file} tokens.
  • gobin (bool) - When enabled, will inject a GOBIN environment variable into your shell. Defaults to true.
[tools.go]
dist-url = "https://..."
gobin = false

Hooks

Post-install

After installation, we'll inject a GOBIN environment variable into your shell, pointing to ~/go/bin, if it does not already exist. This variable will be used to locate Go binaries across all installed versions. This functionality can be skipped by passing --no-gobin during installation, or setting the gobin configuration to false.

proto install go -- --no-gobin

Contributing

Build the plugin:

cargo build --target wasm32-wasi

Test the plugin by running proto commands.

proto install go-test
proto list-remote go-test