Goblin

Golang binaries in a curl, built by goblins

$ curl -sf https://goblin.reaper.im/github.com/rakyll/hey | sh

Introduction

Goblin allows you to install go binaries from the commandline without Go to be installed locally. We streamline this process by cross-compiling binaries on request and caching for subsequent installations.

While goblin is a free service and open source, server's aren't. It'd be of great help if you'd support the project.

Usage

Install PKG with optional @VERSION

$ curl -sf https://goblin.reaper.im/<PKG>[@VERSION] | sh

Note: the PKG part has to contain the entire package path of the module, so barelyhuman/commitlog will be github.com/barelyhuman/commitlog and yaml.v2 will be gopkg.in/yaml.v2

Install PKG to directory PREFIX

$ curl -sf https://goblin.reaper.im/<PKG>[@VERSION] | PREFIX=/tmp sh

The directory will be created if it does not exist.

This might create issues in certain cases so it's prefered that you check if the directory exists on the system already. The default directory is /usr/local/bin and is expected to exist in most systems.

Install PKG to an custom named binary OUT

$ curl -sf https://goblin.reaper.im/<PKG>[@VERSION] | OUT=example.exe sh

Specifically necessary if you are working Windows and need the `exe` executable, in someplace handy.

Examples

Install the latest version of hey

$ curl -sf https://goblin.reaper.im/github.com/rakyll/hey | sh

Install statico@v0.0.7

$ curl -sf https://goblin.reaper.im/github.com/barelyhuman/statico@v0.0.7 | sh

Version can be exact – v1.2.3 or implicit – v1 with the v being optional

Install latest version of godoc from golang.org/x/tools/godoc

$ curl -sf https://goblin.reaper.im/golang.org/x/tools/godoc | sh

How does it work?

Each request resolves the needed tags and versions from proxy.golang.org and responds with a shell script which performs a second request populated with the resolved version and architecture as shown here:

https://goblin.reaper.im/binary/github.com/rakyll/hey?os=darwin&arch=amd64&version=v0.1.3&out=hey

The response of this request is a Golang binary compiled for the requested os, architecture,package version, and the binary's name to used

The result will be cached in a CDN for subsequent requests in a future version

Caveats

  • Must have atleast one version on proxy.golang.org or if using Github packages, you can try with the commit hash
  • Must compile in 200 seconds, due to timeout restrictions

FAQ

What's wrong with go-get?

The user must have Go installed to use go-get. Goblin makes your program accessible to all, including situations where the Go toolchain may be unavailable.

Which version of Go is used?

Currently Go 1.17.x via the official golang:1.17 Docker image.

Does it support Caching?

Not yet, but future version of goblin will, watch us on github to track the progress

Can I use commit hashes?

Yes, you can send a commithash in place of @VERSION and it'll try to build it with the given hash.

curl -sf https://goblin.reaper.im/github.com/barelyhuman/commitlog@bba8d7a63d622e4f12dbea9722b647cd985be8ad

0 hits