1. go mod 添加本地package依赖

go mod 作为golang新的版本管理工具,减少了对GOPATH的依赖。
但是对本地文件的依赖的时候,提示
build server: cannot find module for path *****
处理步骤

  1. 依赖的包生成模块
    go mod init helloworld
  2. 工程文件中,go.mod添加依赖配置
  require helloworld v0.0.0
  replace helloworld v0.0.0 => ../helloworld
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄

SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。