显示HN:为您的用户构建的,取决于他们的架构和系统的Golang二进制文件
Show HN: Golang binaries built for your users depending on their arch and system

原始链接: https://goblin.run

## Goblin: 轻松安装 Go 二进制文件 Goblin 允许您无需安装 Go 环境,即可从命令行直接安装 Go 二进制文件。只需使用 `curl -sf http://goblin.run/ | sh` 下载并执行预编译的二进制文件。 **主要特性:** * **版本控制:** 使用 `@version` (例如 `@v1.2.3`) 指定版本,或使用提交哈希值。 * **自定义:** 使用 `PREFIX=/path` 控制安装位置,使用 `OUT=filename` 控制二进制文件名。您还可以使用 `CMD_PATH` 指定二进制文件路径。 * **灵活的源:** 支持来自 GitHub 和其他来源(如 `golang.org/x/tools`)的包。 * **嵌套包:** 支持安装带有 `cmd/` 目录的包。 Goblin 通过 proxy.golang.org 解析标签/版本,并使用 Go 1.17.x 在 Docker 容器中编译二进制文件。编译时间限制为 200 秒。请考虑捐赠以支持项目的服务器成本和开源开发。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 展示 HN: 为你的用户构建的,根据他们的架构和系统的 Golang 二进制文件 (goblin.run) 4 点赞 by aliezsid 1 小时前 | 隐藏 | 过去 | 收藏 | 讨论 帮助 考虑申请 YC 的 2026 年夏季批次!申请截止至 5 月 4 日 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系方式 搜索:
相关文章

原文

Install Go binaries—without Go.

curl -sf http://goblin.run/github.com/rakyll/hey | sh

If you get value from using Goblin, please consider donating. This helps cover server costs and supports my open source work.

Usage

Install package with optional @version and options:

curl -sf http://goblin.run/<package>[@version] | [...options] sh

API

package - Complete module path

github.com/barelyhuman/commitlog
gopkg.in/yaml.v2

version - Exact or partial version range, optionally prefixed with "v"

# Install the latest version
<package>

# Install v1.2.3
<package>@v1.2.3

# Install v3.x.x
<package>@v3

Options

Control Goblin's behavior with environment variables

PREFIX - Change installation location (default: /usr/local/bin)

# Install to /tmp
... | PREFIX=/tmp sh

OUT - Rename the resulting binary (default: <package name>)

# Export Windows executable
... | OUT=example.exe sh

CMD_PATH - Path to the binary package (default: "")

# Export Windows executable
... | CMD_PATH="/cmd/example" sh

Examples

Install the latest version:

curl -sf http://goblin.run/github.com/rakyll/hey | sh

Specify package version:

curl -sf http://goblin.run/github.com/barelyhuman/[email protected] | sh

Or use commit hashes:

curl -sf http://goblin.run/github.com/barelyhuman/commitlog@bba8d7a63d622e4f12dbea9722b647cd985be8ad | sh

Use alternative sources:

curl -sf http://goblin.run/golang.org/x/tools/godoc | sh

Specify nested packages

Note: nested package expect the path to be a package main file with a main
call. If you use something like spf13/cobra then check the 2nd example.

curl -sf http://goblin.run/vito/bass/cmd/bass | sh
curl -sf http://goblin.run/gnorm.org/gnorm | CMD_PATH="/cli" PREFIX=./bin sh

How does it work?

Each request resolves the needed tags and versions from
proxy.golang.org. If no module is found, you can try
replacing the version with a commit hash on supported platforms, e.g. GitHub.

The response of this request is a Golang binary compiled for the requested
operating system, architecture, package version, and the binary's name—using Go
1.17.x via the official Docker image.

Example response

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

Note: compilation is limited to 200 seconds due to timeout restrictions.

联系我们 contact @ memedata.com