Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/tylercasper/govers

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/tylercasper/govers

  • v0.0.0-20200611155053-a00ba11480d2
  • Source
  • Go
  • Socket score

Version published
Created
Source

The govers command searches all Go packages under the current directory for imports with a prefix matching a particular pattern, and changes them to another specified prefix. As with gofmt and gofix, there is no backup - you are expected to be using a version control system. It prints the names of any packages that are modified.

Usage:

govers [-d] [-m regexp] [-n] new-package-path

It accepts the following flags:

-d
	Suppress dependency checking
-m regexp
	Search for and change imports which have the
	given pattern as a prefix (see below for the default).
-n
	Don't make any changes; just perform checks.

If the pattern is not specified with the -m flag, it is derived from new-package-path and matches any prefix that is the same in all but version. A version is defined to be an element within a package path that matches the regular expression "(/|.)v[0-9.]+(-unstable)?".

The govers command will also check (unless the -d flag is given) that no (recursive) dependencies would be changed if the same govers command was run on them. If they would, govers will fail and do nothing.

For example, say a new version of the tomb package is released. The old import path was gopkg.in/tomb.v2, and we want to use the new verson, gopkg.in/tomb.v3. In the root of the source tree we want to change, we run:

govers gopkg.in/tomb.v3

This will change all gopkg.in/tomb.v2 imports to use v3. It will also check that all external packages that we're using are also using v3, making sure that our program is consistently using the same version throughout.

FAQs

Package last updated on 11 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc