// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // licence that can be found in the LICENSE file. // The gomvpkg command moves go packages, updating import declarations. // See the -help message or Usage constant for details. package main import ( "flag" "fmt" "go/build" "os" "golang.org/x/tools/go/buildutil" "golang.org/x/tools/refactor/rename" ) var ( fromFlag = flag.String("from", "", "Import path of package to be moved") toFlag = flag.String("to", "", "Destination import path for package") vcsMvCmdFlag = flag.String("vcs_mv_cmd", "", `A template for the version control system's "move directory" command, e.g. "git mv {{.Src}} {{.Dst}}"`) helpFlag = flag.Bool("help", false, "show usage message") ) func init() { flag.Var((*buildutil.TagsFlag)(&build.Default.BuildTags), "tags", buildutil.TagsFlagDoc) } const Usage = `gomvpkg: moves a package, updating import declarations Usage: gomvpkg -from -to [-vcs_mv_cmd