Questions tagged [gopath]

The GOPATH environment variable is used to specify directories outside of $GOROOT that contain the source for Go projects and their binaries.

See the go command and go/build package documentation for more details.

99 questions
1
vote
1 answer

How to configure Intellij

I have a skaffold Go project which I cloned. Now I want to run this Go project. I had set up the configuration in project setting and GOPATH is also correctly set. I am getting error while setting this configuration. These are my GOPATH…
prashant
  • 2,808
  • 5
  • 26
  • 41
1
vote
0 answers

How to share a local module in Go 1.11+ for Golang using monolithic repo architecture outside GOPATH

Context: We are using a monolithic repository architecture. This means we have one big github repo with many projects, each project using its own tech stack for ui, node, go, etc. > /home/workspace/ > ./nodejs_project1 > …
bjm88
  • 690
  • 1
  • 8
  • 16
1
vote
0 answers

No buildable Go Source Files when attempting to go get

I'm in the process of deploying my go fileserver on an ubuntu server, but when I run go get cms-web-server from my $GOPATH directory, I get the following error: src/cms-web-server/main.go:18:2: no buildable Go source files in…
P A S H
  • 459
  • 1
  • 5
  • 15
1
vote
1 answer

cannot find vendor directory under golang project

My golang version is go1.10.2 linux/amd64. I can build and run my go project(under gopath/src) without any problem but I cannot see vendor directory under my project folder. I would like to know if the vendor folder is a hidden directory? What are…
bunny
  • 1,797
  • 8
  • 29
  • 58
1
vote
1 answer

Cannot find package when deploy to App Engine

I can not deploy my golang application (with echo framework) on App Engine. I have some kind of error like: ... Step #0: main.go:4:2: cannot find package "FBackend/router" in any of: Step #0: /usr/local/go/src/FBackend/router (from $GOROOT) Step…
Hasdfa
  • 156
  • 3
  • 11
1
vote
1 answer

Wrong gopath when debugging project in VS Code

From one day to the next I can't manage to debug a project where everything worked perfectly before. I'm sure I haven't changed anything about the project or its settings during this time. All I did was work on another project in the same IDE (VS…
Martin Niederl
  • 649
  • 14
  • 32
1
vote
1 answer

How can I configure go sdk and GOPATH from docker container?

I'm trying to configure golang project with Jetbrains Gogland and docker compose. I want to use GOPATH and go from the docker container. I mean using the go installation from the container for the autocomplete etc without installing golang on the…
Oleksandr Dashkov
  • 2,249
  • 1
  • 15
  • 29
1
vote
1 answer

Cannot find package under GOPATH

I am trying to install the dependencies of my project with glidebut unfortunately it fails with the following message: main.go:7:2: cannot find package "github.com/arschles/go-in-5-minutes/episode13/models" in any of: …
thitami
  • 828
  • 2
  • 21
  • 44
0
votes
1 answer

go.mod vs GOPATH

I am currently migrating from GOPATH to go.mod. However, I cannot understand this: I read everywhere that GOPATH and go.mod does not mix, either this or that but then the go modules use GOPATH to download requirements... So, the go modules…
Zoltan K.
  • 1,036
  • 9
  • 19
0
votes
1 answer

Go: Cannot find package in any of Vendor Tree, $GOROOT or $GOPATH even though a private package exists in Vendor Tree

Here's my project structure: Here's my mod file: module github.com/bloodcompany/blood-microservices/stores/sync-stores-google-sheet-to-firestore go 1.16 require ( cloud.google.com/go/firestore v1.6.1 // indirect cloud.google.com/go/kms…
Apurva
  • 7,871
  • 7
  • 40
  • 59
0
votes
0 answers

Build Error: GOPATH set to GOROOT (C:\Users\Admin\go) has no effect, cannot find main module

package main import "fmt" func main() { fmt.Println("hello world") } Its my first code, but ended up with this error, I tried many times to resolve issues like this in VSCode. Build Error: warning: GOPATH set to GOROOT (C:\Users\Admin\go)…
job
  • 11
  • 1
0
votes
1 answer

GO env variable PATH got messed up

I am trying to install package using go with below command: go install fyne.io/fyne/v2/cmd/fyne@latest This is the same as what the instruction said but ideally it should return below message Users/name/go/bin/fyne But when I enter the command it…
ACuriousCat
  • 1,003
  • 1
  • 8
  • 21
0
votes
2 answers

How to solve the import-local-package problem: GOPATH is ignored, only GOROOT takes effects

I'm new in GO and has got stuck in environment configuration for hours. I succeeded to run some test projects, but when I tried to import my custom local packages (say xxx), the "go run" command failed, logging that: *test/main/main.go:6:2: package…
xc wang
  • 318
  • 1
  • 3
  • 14
0
votes
1 answer

Flutter desktop 'hover' can not be recognised

I am trying to run my flutter app on desktop with hover. I ran this command to install hover go get -u github.com/go-flutter-desktop/hover I have GO installed and the command above finishes the installation without any error, however when I try to…
Norbert
  • 6,874
  • 14
  • 40
  • 65
0
votes
1 answer

How to update the GOPATH for VS Code Go extension tools?

My $GOPATH is /home/shambhav/code_mis/golang(current gopath), but long ago when I was setting up GO, I messed it up and GOPATH was /home/shambhav/home/shambhav/code_mis/golang(previous gopath). I noticed this and deleted the contents of…
Shambhav
  • 813
  • 7
  • 20