Skip to content

Tool to rewrite Go import paths and package import comments for vendoring

License

Notifications You must be signed in to change notification settings

dmitris/prewrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prewrite

Build Status

The repository contains plist and prewrite tools under cmd/ subdirectory.

Install

go get github.com/dmitris/prewrite/...

prewrite

Usage:

prewrite -p prefix [-r] [-v] [path ...]

Command-line arguments

  • -from -- the old prefix to change in the imports statements (required)
    • to -- new prefix to add instead of the old one
  • -v -- verbosely print the names of the changed files

If not provided, the path defaults to the current directory (will recursively traverse).

The last target parameter can be either a single file or a directory (such as a root of a source tree).

Examples

Change the prefix for all imports (except the standard library) under the current directory from "github.com/" to "gitlab.com/" prewrite -from github.com -to gitlab.com

plist

Usage

usage: plist -prefix [path ...]
  -all
    	list all imports (-p is ignored)
  -o string
    	output file to write the imports listing
  -p string
    	import prefix to match
  -v	verbose

About

Tool to rewrite Go import paths and package import comments for vendoring

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages