Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tv42/gofmt-runner
gofmt-runner executes the real gofmt based on the GOROOT of the default Go compiler.
https://github.com/tv42/gofmt-runner
golang
Last synced: 20 days ago
JSON representation
gofmt-runner executes the real gofmt based on the GOROOT of the default Go compiler.
- Host: GitHub
- URL: https://github.com/tv42/gofmt-runner
- Owner: tv42
- License: mit
- Created: 2018-11-17T21:54:13.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-17T21:55:08.000Z (about 6 years ago)
- Last Synced: 2024-10-16T02:07:23.678Z (2 months ago)
- Topics: golang
- Language: Go
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gofmt-runner -- Execute gofmt, where ever it may be
`gofmt-runner` executes the real gofmt based on the `GOROOT` of the
default Go compiler.The intent is to make switching between Go SDKs using
https://godoc.org/golang.org/dl easier, mostly by avoiding dangling
`gofmt` symlinks to a removed SDK.If you use golang.org/dl, you end up with multiple `goX.Y`
executables. To choose which one is the default Go version to run, the
easiest thing is to symlink one of them to `go`. The easiest way to
choose a `gofmt` version has been to make `gofmt` be a symlink
pointing to something like `/home/MYUSER/sdk/go1.11.2/bin/gofmt`.
That's just annoying, and prone to dangling symlinks as you remove old
Go versions from `~/sdk`.Instead, make your `gofmt` executable be `gofmt-runner`, and it'll use
your default `go` command to find out which `gofmt` version to
execute. From now on, as you upgrade Go versions, you only need to
update the `go` symlink.