gtc

command module
v0.0.0-...-3a2791a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2020 License: MIT Imports: 3 Imported by: 0

README

Go Tool Catalog

GoDoc Actions/Go Go Report Card

Gtc installs and updates well known tools written by golang.

Install gtc

$ go get -u github.com/koron/gtc

Usages

# List tools installed
$ go list

# List tools not-installed
$ go list -filter notinstalled

# List tools unknown (for gtc)
$ go list -filter unknown

# Install a tool
$ go install jvgrep

# Install multiple tools
$ go install goimports golint jvgrep

# Update a tool
$ go update jvgrep

# Update multiple tools
$ go update goimports golint jvgrep

# Update all tools which has been installed and not touched over 5 days
$ go update -all

Customize with your own catalog

Create a new repository github.com/{YOURNAME}/mygtc with main.go like this:

package main

import (
	"fmt"
	"os"

	"github.com/koron/gtc/gtcore"
)

func main() {
	err := gtcore.DefaultCatalog.Merge([]gtcore.Tool{
		{
			Path: "github.com/{YOURNAME}/mygtc",
			Desc: "My own go tools catalog",
		},
		// FIXME: add your favorite tools at here!
	}...).Run(os.Args)
	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}
}

And push it to github, then install it:

$ go get -u github.com/{YOURNAME}/mygtc

Now you can run mygtc instead of gtc.

Customize with JSON

To load your own catalog from a file, prepare a JSON file like below. And set its filename to GTC_CATALOG_FILE environment variable. It will be merged with the default catalog. But tools in the default catalog overrides same name tools in your catalog.

If you consider to manage your own catalog with git, you should manage it in golang - main.go instead of JSON. It can override the default catalog entirely.

[
  {
    "path": "github.com/foo/foo",
    "desc": "your favorite foo"
  },
  {
    "path": "github.com/foo/bar",
    "desc": "your favorite bar"
  },
  ...(other your favorite tools)...
]

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL