pantheon-se / go-composer
Installs Go into vendor/bin
Installs: 32
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 9
Forks: 0
Open Issues: 0
Type:composer-plugin
Requires
- php: >=7.1
- composer-plugin-api: >=2.0
- ext-json: *
- ext-zip: *
- composer/composer: >=2.0
- symfony/process: >=3.3
README
Go Composer
Composer Plugin to install other utilities via Composer with Go.
Based on node-composer by mariusbuescher, this Composer plugin will install a version of Go into your vendor/bin directory so that they are available to use during your Composer builds. This plugin helps automate the download of the binaries which are linked to the bin-directory specified in your composer.json.
Once installed, you can then use Go in your composer-scripts.
Setup
Simply install the plugin, and the latest Go will be installed - no other configurations are necessary. Optionally, you can specify the go-version
in your composer.json extra configs to declare a specific version of Go.
Example composer.json
{ "name": "my/project", "type": "project", "license": "MIT", "require": { "pantheon-se/go-composer": "*" }, "extra": { "pantheon-se": { "go-composer": { "go-version": true } } }, "config": { "allow-plugins": { "pantheon-se/go-composer": true } } }
Configuration
There are three parameters you can configure:
- Go version (
go-version
) - The download url template for the Go binary archives (
go-download-url
).
In the Node download url, replace the following placeholders with your specific needs:
- version:
${version}
- type of your os:
${osType}
- system architecture:
${architecture}
- file format
${format}
Example composer.json with specific versions of Go
{ "extra": { "pantheon-se": { "go-composer": { "go-version": "1.20.2", "go-download-url": "https://go.dev/dl/go${version}.${osType}-${architecture}.${format}" } } } }