Skip to content

Composer Plugin to install other utilities via Composer with Go.

License

Notifications You must be signed in to change notification settings

pantheon-se/go-composer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Packagist Version Tests

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}"
      }
    }
  }
}

About

Composer Plugin to install other utilities via Composer with Go.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages