gomod

package module
v0.0.0-...-c4990d6 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 20 Imported by: 0

README

gomod

go mod manager: analyzed and upgrade project dependencies

install

go install gitter.top/apps/gomod/...@latest

usage

x@fedora:~/GolandProjects/gomod$ gomod -h
go mod manager

Usage:
  gomod [flags]
  gomod [command]

Available Commands:
  analyzed    analyzed project dependencies
  help        Help about any command
  upgrade     update project dependencies to latest

Flags:
  -h, --help   help for gomod

Use "gomod [command] --help" for more information about a command.

you can show go.mod available updates using gomod:

x@fedora:~/GolandProjects/gomod$ gomod
             PACKAGE            | RELATION |              CURRENT               |               LATEST                
--------------------------------+----------+------------------------------------+-------------------------------------
  github.com/fatih/color        | direct   | v1.7.0                             | v1.17.0
  github.com/mattn/go-colorable | indirect | v0.1.2                             | v0.1.13
  github.com/mattn/go-isatty    | indirect | v0.0.8                             | v0.0.20
  github.com/mattn/go-runewidth | indirect | v0.0.9                             | v0.0.16
  golang.org/x/tools            | indirect | v0.13.0                            | v0.24.0
  golang.org/x/xerrors          | indirect | v0.0.0-20191204190536-9bdfabe68543 | v0.0.0-20240903120638-7835f813f4da
  gopkg.in/check.v1             | indirect | v0.0.0-20161208181325-20d25e280405 | v1.0.0-20201130134442-10cb98267c6c

upgrade go.mod using gomod u:

x@fedora:~/GolandProjects/gomod$ gomod u
[INFO] [url=github.com/google/go-github/v64@v64.0.0] upgrade success
[INFO] [url=github.com/sirupsen/logrus@v1.9.3] upgrade success
[INFO] [url=github.com/spf13/cobra@v1.8.1] upgrade success
[INFO] [url=github.com/stretchr/testify@v1.9.0] upgrade success
[INFO] [url=gitter.top/common/lormatter@v0.0.1] upgrade success
[INFO] [url=golang.org/x/mod@v0.20.0] upgrade success
[INFO] [url=golang.org/x/net@v0.28.0] upgrade success

analyzed project dependencies:

x@fedora:~/GolandProjects/gomod$ gomod u
                PACKAGE                | RELATION |              VERSION               | GOVERSION | TOOLCHAINS  
---------------------------------------+----------+------------------------------------+-----------+-------------
  gitter.top/apps/gomod                | main     |                                    |      1.20 |
  github.com/briandowns/spinner        | direct   | v1.23.1                            |      1.17 |
  github.com/cpuguy83/go-md2man/v2     | indirect | v2.0.4                             |      1.11 |
  github.com/davecgh/go-spew           | indirect | v1.1.1                             |           |
  github.com/fatih/color               | direct   | v1.7.0                             |           |
  github.com/google/go-cmp             | indirect | v0.6.0                             |           |
  github.com/google/go-github/v64      | direct   | v64.0.0                            |      1.21 |
  github.com/google/go-querystring     | indirect | v1.1.0                             |      1.10 |
  github.com/inconshreveable/mousetrap | indirect | v1.1.0                             |      1.18 |
  github.com/mattn/go-colorable        | indirect | v0.1.2                             |           |
  github.com/mattn/go-isatty           | indirect | v0.0.8                             |           |
  github.com/mattn/go-runewidth        | indirect | v0.0.9                             |       1.9 |
  github.com/olekukonko/tablewriter    | direct   | v0.0.5                             |      1.12 |
  github.com/pmezard/go-difflib        | indirect | v1.0.0                             |           |
  github.com/russross/blackfriday/v2   | indirect | v2.1.0                             |           |
  github.com/sirupsen/logrus           | direct   | v1.9.3                             |      1.13 |
  github.com/spf13/cobra               | direct   | v1.8.1                             |      1.15 |
  github.com/spf13/pflag               | indirect | v1.0.5                             |      1.12 |
  github.com/stretchr/objx             | indirect | v0.5.2                             |           |
  github.com/stretchr/testify          | direct   | v1.9.0                             |      1.17 |
  gitter.top/common/lormatter          | direct   | v0.0.1                             |      1.21 |
  golang.org/x/crypto                  | indirect | v0.26.0                            |           |
  golang.org/x/mod                     | direct   | v0.20.0                            |      1.18 |
  golang.org/x/net                     | direct   | v0.28.0                            |      1.18 |
  golang.org/x/sys                     | indirect | v0.24.0                            |      1.18 |
  golang.org/x/term                    | indirect | v0.23.0                            |      1.18 |
  golang.org/x/text                    | indirect | v0.17.0                            |           |
  golang.org/x/tools                   | indirect | v0.13.0                            |           |
  golang.org/x/xerrors                 | indirect | v0.0.0-20191204190536-9bdfabe68543 |      1.11 |
  gopkg.in/check.v1                    | indirect | v0.0.0-20161208181325-20d25e280405 |           |
  gopkg.in/yaml.v3                     | indirect | v3.0.1                             |           |

feature

  • gomod show go.mod available updates
  • gomod u upgrade go.mod
  • gomod a analyzed project dependencies

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Analyzed

func Analyzed()

func ElemIn

func ElemIn(elems []string, target string) bool

func GetModFile

func GetModFile(mf string) (*modfile.File, error)

func ModUpgrade

func ModUpgrade(upgradeIndirect bool)

func UpdateList

func UpdateList()

Types

type Module

type Module struct {
	Path       string       // module path
	Query      string       // version query corresponding to this version
	Version    string       // module version
	Versions   []string     // available module versions
	Replace    *Module      // replaced by this module
	Time       *time.Time   // time version was created
	Update     *Module      // available update (with -u)
	Main       bool         // is this the main module?
	Indirect   bool         // module is only indirectly needed by main module
	Dir        string       // directory holding local copy of files, if any
	GoMod      string       // path to go.mod file describing module, if any
	GoVersion  string       // go version used in module
	Retracted  []string     // retraction information, if any (with -retracted or -u)
	Deprecated string       // deprecation message, if any (with -u)
	Error      *ModuleError // error loading module
	Origin     any          // provenance of module
	Reuse      bool         // reuse of old module info is safe
}

type ModuleError

type ModuleError struct {
	Err string // the error itself
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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