How to handle go dependencies

Dmitri Goutnik dg at syrec.org
Sun Jun 23 13:16:09 UTC 2019


On 19-06-23 12:47:22, Kurt Jaeger wrote:
> Hi!
> 
> [...]
> > > can't load package: package github.com/osrg/gobgp/gobgpd: cannot find package "github.com/osrg/gobgp/gobgpd" in any of:
> > > 	/usr/local/go/src/github.com/osrg/gobgp/gobgpd (from $GOROOT)
> > > 	/home/pi/m/net/gobgp/work/src/github.com/osrg/gobgp/gobgpd (from $GOPATH)
> > > *** Error code 1
> > 
> > You need USES=go:modules not just USES=go.
> 
> Thanks. This changes the 'cd' at the beginning from
> 
> cd /home/pi/m/net/gobgp/work/src/github.com/osrg/gobgp
> 
> to
> 
> cd /home/pi/m/net/gobgp/work/gobgp-2.5.0
> 
> and with a slightly different error:
> 
> can't load package: package github.com/osrg/gobgp/gobgp: cannot find package "." in:
>        /home/pi/m/net/gobgp/work/gobgp-2.5.0/gobgp
> 
> I do not think that I understand what's going on 8-}
> 

It appears that upstream moved gobgp and gobgpd packages to ./cmd, so 
GO_TARGET needs to be updated:

-GO_TARGET=     ${GO_PKGNAME}/gobgp \
-               ${GO_PKGNAME}/gobgpd
+GO_TARGET=     ./cmd/gobgp \
+               ./cmd/gobgpd

-- 
Dmitri Goutnik
dg at syrec.org


More information about the freebsd-ports mailing list