How to use package manager, gopm

1.4k views Asked by At

I am in the process of experimenting with the various package manager offerings on, well, offer for Go. I like what I read in gopm - simple. However, thus far I cannot get past the very first hurdle. Here is what I am doing

  • Install gopm from source via go get github.com/gpmgo/gopm
  • Check that it did install. whereis gopm returns /opt/gopkg/bin/gopm
  • For good measure check my environment variables. echo $GOPATH returns /opt/gopkg.
  • Create main.go under /var/www/html/rest. The code reads

    package main import("github.com/astaxie/beego")

    func main(){ println("Beego version:beego.VERSION) }

  • Create the .gopmfile. It reads [target] path=rest

  • Switch to the /var/www/html/rest folder. At this point it contains

    root root 20 Jun 25 09:13 .gopmfile root root 107 Jun 25 09:13 main.go

  • Now issue a gopm build. which comes back with [GOPM] 15-06-25 09:28:13 [FATAL]: package not installed github.com/astaxie/beego

  • Examine the /var/www/html/rest folder. It now contains an additional folder .vendor which in turn contains the folder src which in turn has a symlink to the /var/www/html/rest folder.

What am I doing wrong here?

1

There are 1 answers

1
XORshift On

You did not include the dependencies section in your .gopmfile file, which should look something like this:

[target]
path = rest

[deps]
github.com/astaxie/beego = tag:v0.9.0