vendorverify

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

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

Go to latest
Published: Mar 26, 2020 License: MIT Imports: 6 Imported by: 0

README

vendor-verify

It is a simple tool for go mod and vendor verification.

The go.mod file will be changed by some reasons, you need run go mod vendor to copy the references to vendor folder. If you forgot run go mod vendor then it may case out of sync, the references will backforward with go.mod, you know, it could raise an online accident...

How to works

In the go.mod file record the package names and versions, and the vendor root path will have modules.txt which still store the package names and versions. This tool will check both of them.

How to install
go get -u github.com/Jiu2015/vendor-verify/vendor-verify
How to use
vendor-verify verify --path <the path of your project>

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadModulesFile

func LoadModulesFile(path string) (map[string]*Package, error)

LoadModulesFile load modules.txt file it will return map[string]*package, the key is package name, the value is package pointer

func StartVerify

func StartVerify(modFilePath, modulesFilePath string) error

StartVerify start verify

Types

type ModFile

type ModFile struct {
	Packages []*Package
}

ModFile go mod/modules package infos

func LoadModFile

func LoadModFile(path string) (*ModFile, error)

LoadModFile it will load go.mod file

func NewModFile

func NewModFile() *ModFile

NewModFile create new ModFile object

func (*ModFile) AppendPackage

func (m *ModFile) AppendPackage(pk *Package)

AppendPackage append package to ModFile

type Package

type Package struct {
	Name    string
	Version string
	Tag     string
}

Package store the package information

func ParsePackage

func ParsePackage(p string) (*Package, error)

ParsePackage get Package object from string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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