Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
38 views

if you enter the command "go evn" in vs, it shows that GOPATH=C:\Users\user\go. if I want to change GOPATH in vs code, how do I do it? The book I'm reading says: set GOPATH="C:\code&...
Руслан Козлов's user avatar
0 votes
1 answer
217 views

I use Windows and WSL for developing Go code, but, don't know if I need to have a separate $GOPATH for Windows and WSL, or if I can use the same $GOPATH for both. Can you use the same $GOPATH between ...
bp256r1's user avatar
  • 301
0 votes
1 answer
461 views

I'm trying to build a completely new project in order to run some unit tests. I'm using Windows + WSL. When I try to run the tests, obviously first it takes the go.mod file and starts downloading all ...
Radu Z.'s user avatar
  • 23
0 votes
1 answer
1k views

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 ...
Zoltan K.'s user avatar
  • 1,230
2 votes
3 answers
1k views

I 'm new to Hyperleger Fabric and trying to done examples from Using the Fabric test network documentation. I'm stuck on the phase of starting a chaincode on the channel. I am getting error located ...
umitkilic's user avatar
  • 353
1 vote
0 answers
609 views

I have the following project structure proejct/ ├── README.md ├── go.mod ├── go.sum ├── src │ ├── delivery │ │ ├── grpc │ │ │ ├── index.go │ │ │ ├── pb │ │ │ │ ├── project.pb....
mrpandey's user avatar
  • 1,159
1 vote
1 answer
409 views

Asking to see what the appropriate workaround is for building individual go packages from the go/std library when working on a github repo fork. The issue encountered is summarized by the following ...
Brian Anderson's user avatar
3 votes
2 answers
2k views

Installed using, go get github.com/githubnemo/CompileDaemon and go install github.com/githubnemo/CompileDaemon When I try to run it using -> CompileDaemon --compile="./folderName" It ...
Praful Nalatwad's user avatar
0 votes
2 answers
2k views

I made a mistake: go env -w GOROOT=/Users/apple/Documents/testProject/GXB_be:/usr/local/go I set a wrong path as a variable of go env. This makes it almost impossible for me to use the go env command ...
baitao C's user avatar
0 votes
1 answer
525 views

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 ...
Apurva's user avatar
  • 7,911
0 votes
0 answers
3k views

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 ...
job's user avatar
  • 11
0 votes
1 answer
2k views

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/...
RiffRaffCat's user avatar
  • 1,041
2 votes
1 answer
5k views

Can anyone explain when to set $GOPATH? I know it's in the default, C:\Users\Username\go, location, but what if all my coding projects live in Z:<codelocation> ?
Justin Reddick's user avatar
2 votes
0 answers
690 views

I'm trying to setup the vim-go in a work environment but I don't have permission to install the gopls using: GoInstallBinaris or go get golang.org/x/tools/gopls@latest I'm getting this: /path/go/bin/...
vidola's user avatar
  • 344
-3 votes
2 answers
5k views

I'm learning Go ad I'm trying to build go file: package main import ( "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "net/http" ) func ...
Vad Sim's user avatar
  • 316
1 vote
1 answer
459 views

I'm using golang and GoLand(Jetbrains)IDE for development on UBUNTU. My Go path is /usr/local/go and my Project Directory is at /Home/GoLandProjects with bin, src, pkg directories and my project ...
Zain Ur Rehman's user avatar
1 vote
1 answer
650 views

I have done basic setup in Hyperledger Fabric 1.4.7 and made all peer's to join the channel. After exploring chaincode in golang, I started trying chaincode install command and I was facing issue's in ...
Dev's user avatar
  • 92
-5 votes
2 answers
2k views

go: GOPATH entry is relative; must be absolute path: "%Jittu%\go". For more details see: 'go help gopath
Jittu Rohtaki's user avatar
-1 votes
1 answer
786 views

I am trying to learn how to build a webserver using go and mux. I am importing mux to the main.go file as import github.com/gorilla/mux. However, when I am trying to run the code. I get the following ...
Michio Kaku's user avatar
0 votes
2 answers
3k views

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" ...
xc wang's user avatar
  • 372
12 votes
4 answers
41k views

I installed Golang and faced with go.mod file not found in current directory or any parent directory error at very first time. But I'm working on <GOPATH>/src directory. Isn't go.mod only ...
Han's user avatar
  • 129
0 votes
1 answer
261 views

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 ...
Norbert's user avatar
  • 7,810
0 votes
1 answer
5k views

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 ...
Shambhav's user avatar
  • 863
0 votes
1 answer
1k views

I have set $GOPATH, and importing some part of my source code which is present in $GOPATH/src. Package I need to import is written by me and stored in GOPATH/src I have named it as otelkafkago and it'...
Kshitij Patil's user avatar
0 votes
3 answers
2k views

My GOROOT path :- C:\Go I have set GOPATH to :- C:\Users\kunal\go But when I import modules (like github.com/gorilla/mux) inside VS Code. VS Code prompts me this error :- could not import github.com/...
Kunal Prakash's user avatar
1 vote
1 answer
136 views

A section of the Go Modules Reference describes some rules for minimal module compatibility. There is a list of conditions in this section and two of them look like this: No $GOPATH[i]/src/$modpath/$...
Andrew Savinykh's user avatar
2 votes
2 answers
1k views

I'm trying to follow the Writing an intepreter in Go book, by Thorsten Ball, and in the first chapter he establish this simple scheme file /Users/myuser/projects/monkey/token/token.go file /Users/...
John Smith's user avatar
-2 votes
1 answer
2k views

I would like to set GOPATH using the go tool upon compilation, just like adding an include path in C/++. I want the gopath to be used only within a certain project. Can this be done without setting an ...
Serket's user avatar
  • 4,555
12 votes
2 answers
18k views

I have the following project structure, outside of GOPATH. . // Project root ├── Dockerfile ├── .env ├── README.md └── src ├── main.go ├── go.mod ├── go.sum ├── internal │   ├── ...
Diego ROJAS's user avatar
-1 votes
1 answer
2k views

just started with go, got stuck on a very simple application (from here https://golang.org/doc/tutorial/call-module-code) when I try to compile the hello.go: ... hello.go:6:5: cannot find module ...
user3391739's user avatar
1 vote
1 answer
506 views

I am very new to golang. I am trying to work with the gomod. Trying to explore the go buffalo framework. But finding a bit of difficulty in installing that. What I have done: I saw that go get is ...
Sayan Dey's user avatar
  • 876
3 votes
2 answers
4k views

so here is what my directory is: go |-src |-ppppppSample |-newFolderOne |-firstSample.go |-hello.go |-go.mod and here is the content of hello.go package main ...
Eien_Zheng YC_'s user avatar
-1 votes
2 answers
1k views

I'm learning to write Golang makefile and got some confused me because some examples they config GO env such as GOOS, GOPATH, GOBASE before building. But normally I can use go mod init to create go ...
Quang's user avatar
  • 185
20 votes
1 answer
11k views

I need to remove absolute path in the trace, that corresponds to the imported module. Even though I compile my program so: go build -gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH I still get ...
gtristan's user avatar
  • 445
3 votes
3 answers
4k views

I want to use spf13/cobra on my project. spf13/cobra: A Commander for modern Go CLI interactions typed install command result $ go get -u github.com/spf13/cobra/cobra go: downloading github.com/spf13/...
nabeen's user avatar
  • 462
0 votes
1 answer
12k views

When running go install on my cmd folder I get the error: go install cmd/go: copying /var/folders/wh/9y99138n2w1bvcwxz3tbb8zw0000g n/T/go-build195667123/b150/exe/a.out: open /usr/local/go/bin/go: ...
Jacob B's user avatar
  • 724
3 votes
1 answer
4k views

package main import ( "fmt" "controller/userhandler" //not able to import this custom package "github.com/gin-gonic/gin" ...
gursharan singh's user avatar
1 vote
1 answer
5k views

I use go env to check the GOPATH: $ go env GOARCH="amd64" GOBIN="/usr/local/Cellar/go/1.7.6/bin" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS=&...
user7693832's user avatar
  • 6,971
0 votes
1 answer
203 views

I am beginner in go and facing difficulty in understanding go/pkg folder.As suggested by documentation it contains pkg/mod and pkg/windowsamd_64. pkg/windowsamd_64 for storing compiled files. What ...
Divanshu Aggarwal's user avatar
1 vote
0 answers
197 views

I was working on a Go project in a directory that was not in my GOPATH. I was using relative imports. I am trying to move the project into my GOPATH so I can stop using relative imports, but I keep ...
mii's user avatar
  • 11
1 vote
1 answer
7k views

I recently rearranged my VS Code workspace. Before rearranging it I had no problems neither with Go modules nor $GOPATH. Now I have adopted the much beloved hexagonal project layout as I find it quite ...
Stroboscopio's user avatar
-1 votes
2 answers
1k views

When I get go libraries from github, I can use them in code. But I cannot use their commands. For example, after "go get annie", I try to use its command, e.g."annie bebe.be/be/bebe". But I get "The ...
Bekassyl's user avatar
13 votes
4 answers
30k views

Before it happened, what I am doing is trying to use the dep to manage my golang code dependency. What I found right now is I cannot do any command with go, even if I try to uninstall it with brew by ...
Mirza's user avatar
  • 311
-1 votes
1 answer
1k views

First of all I'm really new to Go. I've been struggling with this issue for about a week now and its driving me crazy (because of this issue its not recognizing my packages). I have set up my GOPATH ...
sam2013's user avatar
  • 21
0 votes
1 answer
2k views

I'm writing this away from my code so fingers crossed. I've recently started learning Go from a Python background. I've set up my workspace (Linux Mint OS) so: GOPATH=$HOME/go GOROOT=/usr/local/go ...
Alesi Rowland's user avatar
0 votes
1 answer
48 views

I use this code to get a list of dependencies imported in a single Go source file: // GetFileImports returns all the imports from the Golang source code file. func GetFileImports(filepath string) ([]...
zergon321's user avatar
  • 230
5 votes
2 answers
6k views

I have a ~/.config/fish/config.fish which contains the following lines: set PATH $PATH (go env GOPATH)/bin set -x GOPATH (go env GOPATH) If I simply run go env GOPATH at the command line, I get the ...
Kurt Peek's user avatar
  • 58.5k
-1 votes
2 answers
1k views

I installed go1.13.3.darwin-amd64.pkg on Mac. I set env variables in ~/.bash_profile GOPATH = $HOME/gocode GOROOT = /usr/local/go PATH = $PATH:$GOPATH/bin saved the edits with source /....
pretty08's user avatar
  • 157
2 votes
2 answers
4k views

I would like to install a package to GOPATH using go get. This became tricky with go tooling migrated to go mod support. There is no problem outside of the project directory (=directory with go.mod ...
zdebra's user avatar
  • 998
4 votes
3 answers
5k views

I'm following the gRPC Quickstart tutorial for Go, https://grpc.io/docs/quickstart/go/, and have installed gRPC using the command go get -u google.golang.org/grpc I actually haven't defined a GOPATH ...
Kurt Peek's user avatar
  • 58.5k