登录
首页 >  Golang >  Go问答

无法在Golang迁移中找到Bitbucket模块

来源:stackoverflow

时间:2024-02-21 20:51:27 390浏览 收藏

你在学习Golang相关的知识吗?本文《无法在Golang迁移中找到Bitbucket模块》,主要介绍的内容就涉及到,如果你想提升自己的开发能力,就不要错过这篇文章,大家要知道编程理论基础和实战操作都是不可或缺的哦!

问题内容

我正在更新 google 应用引擎应用,以便它使用 golang 1.12。

我被迫使用 go 模块。因此,我正在尝试修改项目来做到这一点。 我更新了 .yml 文件以反映这一点:

runtime: go112
...
- url: /.*
  script: auto

由于我不是最初的开发人员,因此我在使其正常工作时遇到问题。它使用私有位桶。我使用 ssh 密钥进行身份验证,因此 golang 可以在正确调用 git 时获取包。

我在运行“go mod tidy”时仍然遇到问题:

bitbucket.org/nxtlab/sticktothebrand/app imports
    bitbucket.org/nxtlab/sticktothebrand: cannot find module providing package bitbucket.org/nxtlab/sticktothebrand: invalid bitbucket.org/ import path "bitbucket.org/nxtlab"
bitbucket.org/nxtlab/sticktothebrand/gopath/src/bitbucket.org/nxtlab/sticktothebrand imports
    bitbucket.org/nxtlab/sticktothebrand/access: no matching versions for query "latest"

go.mod:

module bitbucket.org/nxtlab/sticktothebrand

go 1.12

require (
# other none bitbucket related packages
)

./app/main.go:

package main

import (
    "bitbucket.org/nxtlab/sticktothebrand"
)

func init() {
    sticktothebrand.run()
}

树-l 2:

├── Makefile
├── app
│   ├── acl.json
│   ├── app.dev.yaml
│   ├── app.prod.yaml
│   ├── app.test.yaml
│   ├── blocks
│   ├── index.yaml
│   ├── main.go
│   ├── manager -> ../manager/dist/
│   └── static
├── docker
│   ├── Dockerfile
│   ├── go.sh
│   └── run.sh
├── go.mod
├── go.sum
├── gopath
│   └── src
├── manager
│   ├── bower.json
│   ├── config.beta.json
│   ├── config.dev.json
│   ├── config.test.json
│   ├── dist
│   ├── e2e
│   ├── gulp
│   ├── gulpfile.js
│   ├── karma.conf.js
│   ├── package.json
│   ├── protractor.conf.js
│   └── src
├── project
│   └── vval2016
└── research
    ├── Screen Shot 2015-09-10 at 11.29.14.png
    ├── Screen Shot 2015-09-10 at 11.30.29.png
    ├── Screen Shot 2015-09-10 at 11.30.55.png
    ├── Screen Shot 2015-09-10 at 11.31.29.png
    ├── Screen Shot 2015-09-10 at 11.31.34.png
    └── Screen Shot 2015-09-10 at 11.32.40.png

解决方案


包中的某些源文件包含类似 import "bitbucket.org/nxtlab/sticktothebrand/access" 的语句。

您的 tree 输出表明不存在 ./access 子目录,因此主模块中不存在该包。 go 命令试图在另一个模块中找到它,但鉴于您的模块路径,我怀疑不存在其他可行的模块。

要修复 go mod tidy,您需要找到并删除错误的 import 语句。

今天关于《无法在Golang迁移中找到Bitbucket模块》的内容就介绍到这里了,是不是学起来一目了然!想要了解更多关于的内容请关注golang学习网公众号!

声明:本文转载于:stackoverflow 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>