gomt

package module
v0.0.0-...-91e0788 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 9 Imported by: 0

README

gomt

Base on go mod graph but with better human readability

gomt

Installation

go get -u github.com/MaruHyl/gomt/gomt

Command Help

Base on go mod graph but with better human readability.

Usage:
  gomt [flags]

Flags:
  -h, --help            help for gomt
  -j, --json            prints out an JSON representation of the tree
  -l, --max_level int   set max level
  -t, --target string   like go mod why ${Target} but with better human readability

Usage example

--max_level

Limit the depth of the tree

gomt -l 1

output

github.com/MaruHyl/gomt
├── github.com/fatih/color@v1.7.0
├── github.com/mattn/go-colorable@v0.1.1
├── github.com/mattn/go-isatty@v0.0.8
└── github.com/spf13/cobra@v0.0.4
--json

Print json format

gomt -l 1 -j

output

{
 "Mod": "github.com/MaruHyl/gomt",
 "Version": "",
 "Deps": [
  {
   "Mod": "github.com/fatih/color",
   "Version": "v1.7.0"
  },
  {
   "Mod": "github.com/mattn/go-colorable",
   "Version": "v0.1.1"
  },
  {
   "Mod": "github.com/mattn/go-isatty",
   "Version": "v0.0.8"
  },
  {
   "Mod": "github.com/spf13/cobra",
   "Version": "v0.0.4"
  }
 ]
}
--target

Like go mod why ${Target} but with better human readability

gomt -t github.com/mattn/go-isatty

output

github.com/MaruHyl/gomt
├── github.com/mattn/go-colorable@v0.1.1
│   └── github.com/mattn/go-isatty@v0.0.5
└── github.com/mattn/go-isatty@v0.0.8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Tree

func Tree(options ...Option) (string, error)

Types

type Option

type Option func(opts *options) error

func WithJson

func WithJson(json bool) Option

Draw mod graph use json

func WithMaxLevel

func WithMaxLevel(maxLevel int) Option

Set max level of tree

func WithTarget

func WithTarget(target string) Option

Draw mod graph only associated with target mod

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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