0

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?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
DroidOS
  • 8,530
  • 16
  • 99
  • 171
  • 1
    i think gopm will not be the regular package manager for go because `go get` is simple and friendly enough for people. to use `go get` i suggest, you will get much supports from SO. – Jiang YD Jun 25 '15 at 10:07
  • @Jiang Fair point. However, does that not leave out package version management? – DroidOS Jun 25 '15 at 10:09
  • 1
    well, currently a go package is just a set of source code(we strict to pure go, no dynamic libraries wrote in c/c++). so I think version management to the sources is the scope of git, that's why `go get` basically just doing a git clone. – Jiang YD Jun 25 '15 at 10:50
  • Like most people, I'm using Mercurial and Git, and I find [Glock](https://github.com/robfig/glock) very effective with these. Gopm seems to be trying to fill a void that doesn't exist: a space without version control systems. That puzzles me. – Rick-777 Jun 25 '15 at 13:18
  • The issue I see with a bare bones `go get` approach is that it does not provide any mechanism for discarding unwanted packages and their dependencies. I have seen suggestions to the effect that one should _just delete_ unwanted packages: which has the potential to leave a bunch of non longer needed packages installed as dependencies by the one that just got deleted. – DroidOS Jun 25 '15 at 13:22
  • I use go get this way. set GOPATH to the working directory and then invoke `go get -u`. it will download/update package to your working directory, not globally. less dependency problems i think. – Jiang YD Jun 26 '15 at 00:33
  • After much searching I have more-or-less settled on [Bunch](https://github.com/dkulchenko/bunch). One of the many things I like about it is that it emulates the behavior of NPM - an excellent model to copy. – DroidOS Jun 25 '15 at 13:20

1 Answers1

-1

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
XORshift
  • 358
  • 4
  • 11