go mod tidy 对于版本管理 - V2EX
请不要在回答技术问题时复制粘贴 AI 生成的内容
xmge

go mod tidy 对于版本管理

  •  
  •   xmge Jul 8, 2020 2517 views
    This topic created in 2149 days ago, the information mentioned may be changed or developed.

    发现 gomodule 项目中,执行 go mod tidy 会发生这样的错误,

     github.com/xormplus/xorm tested by github.com/xormplus/xorm.test imports github.com/go-xorm/core: github.com/go-xorm/[email protected]: parsing go.mod: module declares its path as: xorm.io/core but was required as: github.com/go-xorm/core 

    于是找到两种方式去解决:

    1.全部删除,再执行 go mod tidy 重新生成

    2.添加 replace github.com/go-xorm/core v0.6.3 => xorm.io/core v0.6.3

    但是执行后,go.mod 版本发生了变化,无法做到和之前版本一致,这个问题大家是如何解决的呢?还是这种用法就是错误的,go mod tidy 只能在项目初期使用?

    reus
        1
    reus  
       Jul 8, 2020 via Android
    出错信息已经说了,那个模块是 xorm.io/core 但代码里用了 github 的地址

    是 go mod 声明和 import 地址不一致的问题,全部改成一样的就行
    xmge
        2
    xmge  
    OP
       Jul 8, 2020
    @reus 嗯嗯,这个可以这样改,那 go mod tidy 还能执行吗?执行了版本又变化了
    About       Advertise     Blog     API     FAQ     Solana     4918 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 85ms UTC 09:41 PVG 17:41 LAX 02:41 JFK 05:41
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86