请在提交问题之前回答以下问题。谢谢!
您正在使用的Go版本是什么(go version
)?
1.10.3
这个问题在最新版本中是否重现?
1.10.3是最新的
您正在使用什么操作系统和处理器架构(go env
)?
您做了什么?
go get -u golang.org/x/tools/cmd/gomvpkg
gomvpkg -from istio.io/fortio -to fortio.org/fortio
# the fnet/network.go file has the other package changed but not itself (same for all files):
package fnet // import "istio.io/fortio/fnet"
import (
"fmt"
"io"
"io/ioutil"
"math/rand"
"net"
"os"
"strconv"
"strings"
"sync"
"fortio.org/fortio/log"
"fortio.org/fortio/version"
)
您期望看到什么?
将import注解更改为新位置
您实际上看到了什么?
// import没有改变
3条答案
按热度按时间8nuwlpux1#
另一个无关的错误是,它在顶级go文件中将包名main更改为了fortio。
6g8kf2rb2#
你测试了最新的
gomvpkg
版本吗?我在那里看到了一些代码,用于更新导入路径注解:https://github.com/golang/tools/blob/5fad05c8188830251/refactor/rename/mvpkg.go#L247-L262
它似乎在golang/tools@13be4df版本中为#10508问题实现了。
5uzkadbs3#
我确实看到了三年前的一个链接:https://github.com/golang/tools/blame/master/refactor/rename/mvpkg.go#L253,但是我按照描述/复现中的方法使用了
go get -u
来获取最新的gomvpkg
,但它并没有改变这些行,不知道为什么(是否与包作为给定参数的子包有关?)