Glide cannot find package "." in
Asked Answered
P

2

11

My project tree is $GOPATH/src/gillab.myfirm.ru/golang/rkn

I try to use glide for get dependency glide install and I am stuck with a problem:

[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

I don't understand what exactly glide want from me. What such package is this "." ?

$GOPATH/src/gitlab.myfirm.ru/golang/rkn/event/events.go have only 4 imports

package events

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

same problem I got with another 4 packages.

Pita answered 18/12, 2017 at 20:36 Comment(2)
Is there any other file in $GOPATH/src/gitlab.myfirm.ru/golang/rkn/event besides events.go ? What happens if you remove /Users/droot/.glide/cache/src/https-gitlab.myfirm.ru-golang-rkn/events ?Owings
nope only events.go, use glide cc (clear cache) same resultPita
P
5

I found the answer.

When glide makes cache files, git is in there.

If master have foo package and someBranch have also bar package when you make glide install glide also cache git branches and give from cache master branch as default.

The solution is cd /Users/droot/.glide/cache/src/https-gitlab.myfirm.ru-golang-‌​rkn/ and checkout cache branch git checkout someBranch

Pita answered 18/12, 2017 at 21:59 Comment(0)
K
1

I have found that this error can occur when your Go code attempts to import a package which does not exist in Github or no longer exists.

For example, it used to be that the package github.com/hashicorp/terraformbuiltin/providers/aws existed:

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

But as of Terraform 0.11, it has been moved: https://github.com/hashicorp/terraform/tree/v0.11.2/builtin/providers https://github.com/terraform-providers/terraform-provider-aws

Kibitz answered 25/1, 2018 at 22:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.