Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error cannot find package #144

Closed
delubi opened this issue Mar 15, 2019 · 2 comments
Closed

build error cannot find package #144

delubi opened this issue Mar 15, 2019 · 2 comments

Comments

@delubi
Copy link

delubi commented Mar 15, 2019

New to go and pagerduty. I'm trying to install go-pagerduty on Ubuntu 18.04. Below are the steps that I performed.

as root
cd /root
apt install golang-go
go get github.com/PagerDuty/go-pagerduty

vi ~/.bashrc
export GOPATH=/root/go

source ~/.bashrc
cd $GOPATH/src/github.com/PagerDuty/go-pagerduty
go build -o $GOPATH/bin/pd command/*

It returned error:

root@ubuntu:~/go/src/github.com/PagerDuty/go-pagerduty# go build -o $GOPATH/bin/pd command/*
command/addon_delete.go:5:2: cannot find package "github.com/Sirupsen/logrus" in any of:
	/usr/lib/go-1.10/src/github.com/Sirupsen/logrus (from $GOROOT)
	/root/go/src/github.com/Sirupsen/logrus (from $GOPATH)
command/ability_check.go:5:2: cannot find package "github.com/mitchellh/cli" in any of:
	/usr/lib/go-1.10/src/github.com/mitchellh/cli (from $GOROOT)
	/root/go/src/github.com/mitchellh/cli (from $GOPATH)
command/meta.go:8:2: cannot find package "github.com/mitchellh/go-homedir" in any of:
	/usr/lib/go-1.10/src/github.com/mitchellh/go-homedir (from $GOROOT)
	/root/go/src/github.com/mitchellh/go-homedir (from $GOPATH)
command/addon_list.go:8:2: cannot find package "gopkg.in/yaml.v2" in any of:
	/usr/lib/go-1.10/src/gopkg.in/yaml.v2 (from $GOROOT)
	/root/go/src/gopkg.in/yaml.v2 (from $GOPATH)
root@ubuntu:~/go/src/github.com/PagerDuty/go-pagerduty# 

Any suggestion how to fix it?

@pannon
Copy link

pannon commented Mar 18, 2019

Try:

go get github.com/Sirupsen/logrus github.com/mitchellh/cli github.com/mitchellh/go-homedir gopkg.in/yaml.v2

And re-run the build.

@delubi
Copy link
Author

delubi commented Mar 25, 2019

@pannon Looks good now. Thank you.

@delubi delubi closed this as completed Mar 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants