繁体   English   中英

Glide找不到包“。”

[英]Glide cannot find package “.” in

我的项目树是$GOPATH/src/gillab.myfirm.ru/golang/rkn

我尝试使用滑动来获得依赖glide install ,我遇到了一个问题:

[ERROR] Error scanning gitlab.myfirm.ru/golang/rkn/events: cannot find package "." in:
    /Users/droot/.glide/cache/src/https-gitlab.myfirm.ru-golang-rkn/events

我不明白滑翔到底想要什么。 这个包是什么"."

$GOPATH/src/gitlab.myfirm.ru/golang/rkn/event/events.go只有4个进口

package events

import (
    "github.com/streadway/amqp"
    log "github.com/Sirupsen/logrus"
    "fmt"
    "gitlab.myfirm.ru/golang/rkn/config"
)
........

同样的问题我得到另外4个包。

我找到了答案。

当glide生成缓存文件时,git就在那里。

如果masterfoo packagesomeBranch也有bar package当你进行glide install滑行时也会缓存git branches并从缓存master分支默认给出。

解决方案是cd /Users/droot/.glide/cache/src/https-gitlab.myfirm.ru-golang-‌​rkn/和checkout cache branch git checkout someBranch

我发现当您的Go代码尝试导入Github中不存在或不再存在的包时,可能会发生此错误。

例如,它曾经是包github.com/hashicorp/terraformbuiltin/providers/aws存在:

https://github.com/hashicorp/terraform/tree/v0.9.6/builtin/providers

但截至Terraform 0.11,它已被移动: https//github.com/hashicorp/terraform/tree/v0.11.2/builtin/providers https://github.com/terraform-providers/terraform-provider-aws

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM