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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
user199588
  • 539
  • 2
  • 6
  • 21
  • 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` ? – dlsniper Dec 18 '17 at 20:51
  • 1
    nope only events.go, use `glide cc` (clear cache) same result – user199588 Dec 18 '17 at 20:55

2 Answers2

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

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
user199588
  • 539
  • 2
  • 6
  • 21
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