On Saturday, February 22, 2025 at 7:52:53 PM UTC-5 Björn Försterling wrote:

Hello,

according to "The Go Programming Lanuage" (Alan A. A. Donovan/Brian W. 
Kernighan)
page 291 the "GOPATH" should have a subdirectory named "src".

However that dir is not present on my system:


The Go programming language is covered by a compatibility guarantee.
 
Go 1 and the Future of Go Programs     
https://go.dev/doc/go1compat     

The Go programming tools are not covered by a compatibility guarantee. 

Go Release History    
https://go.dev/doc/devel/release   

Because of the compatibility guarantee, The Go Programming Language by Alan 
A. A. Donovan and Brian W. Kernighan, published Oct 26, 2015, is still 
valid for the programming language. It is often no longer valid for the 
programming tools.    

The Go Programming Language      
https://www.gopl.io/        

Start with the official, authoritative Go documentation, especially, 
Developing modules.

Go Documentation     
https://go.dev/    
https://go.dev/learn/     
https://go.dev/doc/      
 
Some YouTube video book review, found using Google Search, is unlikely to 
be helpful.

peter
 

$ ls $(go env GOPATH)
bin  pkg

When doing a type check with the "go/types" package and the default 
importer (importer.Default()) it will also search the imported package 
inside GOPATH/src:

could not import github.com/Code-Hex/Neo-cowsay/v2 (can't find import: "
github.com/Code-Hex/Neo-cowsay/v2": cannot find package "
github.com/Code-Hex/Neo-cowsay/v2" in any of:
/usr/lib/go/src/github.com/Code-Hex/Neo-cowsay/v2 (from $GOROOT)
/home/bf/go/src/github.com/Code-Hex/Neo-cowsay/v2 (from $GOPATH))

I installed the external package with "go get ..." and I am able to build 
the
module that uses the external package.

Does anyone know how it can happen that $GOPATH/src does not exist?

Regards
Bjoern

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/golang-nuts/ffa6db94-e60c-4daa-b4c1-e38bc72aa474n%40googlegroups.com.

Reply via email to