How to use gilab insted of github for building

installed go
go get gitlab/xxx/grafana (git repo successfully cloned )
go run build.go setup also works fine
go run build.go build but build fails with below error

cannot use commands.Commands (type []“”.Command) as type []“”.Command in assignment

is there any dependency on github ?? can’t i use gitlab like this ??


Did you solve this? Looks like you did not follow the build instructions:

No was not able to build using gitlab

i build using github and deleted git repo which is generated after doing go get

then i cloned git lab repo int the same location where github repo was there

let me know if you have any inputs


1 Like

It does not matter if you get the code from GitHub or Gitlab - it is a Git repo either way.

But it is important what the GOPATH is set to and what the directories are called. Some options:

  • rename your local directory to $GOPATH/src/
  • or symlink it: ln -s $GOPATH/src/ $GOPATH/src/
  • don’t fetch the repo using go get - use git clone instead

P.S. Another way to do it - go get from github then just add your gitlab repo as a git remote (keeping the $GOPATH/src/ directory structure)

1 Like

Faced the same issue, but with symlink approach it worked. Not the best though.