Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/narqo/homebrew-go
Manage Go tools using Homebrew formulas
https://github.com/narqo/homebrew-go
golang homebrew
Last synced: 1 day ago
JSON representation
Manage Go tools using Homebrew formulas
- Host: GitHub
- URL: https://github.com/narqo/homebrew-go
- Owner: narqo
- License: mit
- Created: 2017-12-07T18:09:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-12-10T22:17:23.000Z (about 7 years ago)
- Last Synced: 2024-11-05T11:52:10.690Z (about 2 months ago)
- Topics: golang, homebrew
- Language: Ruby
- Homepage:
- Size: 10.7 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# brew-go
[![experimental](https://badges.github.io/stability-badges/dist/experimental.svg)](https://github.com/badges/stability-badges)
**WARNING**
This is an experimental project and it can break things (*).
---
## Install
~~~
% brew tap narqo/go
~~~## Usage
~~~
% brew go install github.com/google/pprof
...
% which pprof
/usr/local/bin/pprof
~~~To see all supported commands do:
~~~
% brew go help
~~~### Limitations
As it for now, all tools are installed with the `go-` prefix, using the default VCS branch for versioning.
~~~
% brew ls go-pprof
/usr/local/Cellar/go-pprof/devel/bin/pprof
~~~To update the package run:
~~~
brew go reinstall github.com/google/pprof
~~~### Shell Completions
TODO
### Motivation
It might be simple to add `$GOPATH/bin` to the system's `$PATH`. IMHO having third-party tools mixed with your code is not a perfect way of organising development environment. Every time I tried to update a third-party tool via `go get -u ` I had to deal with weird dependency collisions, which happened because of reasons.
I tried to have multiple items in the `$GOPATH` (see my shell configs in the [dotfiles][] repo, if you care) to make some distinguishing between third-party tools and my stuff. But this didn't help when I wanted to remove tools I didn't need or want to have anymore.
homebrew-go is an attempt to solve this issues, by providing a way to manage tools written in Go without the need of pollution your development environment.
### How It Works
Command generates a temporary brew formula and runs `brew install `, which go-gets the package into a separate, per-package `$GOPATH` in the brew's cache directory, e.g. `$HOME/Library/Caches/Homebrew`, and runs the go install into brew's bin directory.
---
\* – I'm not a brew internals expert (neither a ruby developer), so I'm not yet sure how the tool aligns with other brew's things. It works with my test cases, let me know if something doesn't work with yours ;)
The project was deeply inspired by [brew-gem](https://github.com/sportngin/brew-gem).
# License
MIT
[dotfiles]: https://github.com/narqo/dotfiles