Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No src folder although the official guide tells to? #48

Closed
cwansart opened this issue Nov 16, 2019 · 2 comments
Closed

No src folder although the official guide tells to? #48

cwansart opened this issue Nov 16, 2019 · 2 comments

Comments

@cwansart
Copy link

Hey,

I was wonderin what you think about the official Go documentation, which recommends creating a src folder, whereas you tell us not to.

Here's the link: https://golang.org/doc/code.html

@gsom95
Copy link

gsom95 commented Nov 19, 2019

Official Go documentation specifies workspace hierarchy whereas here it's about project hierarchy. That is your project directory is inside workspace directory.
Read this part carefully.

Don't confuse the project level /src directory with the /src directory Go uses for its workspaces as described in How to Write Go Code. The $GOPATH environment variable points to your (current) workspace (by default it points to $HOME/go on non-windows systems). This workspace includes the top level /pkg, /bin and /src directories. Your actual project ends up being a sub-directory under /src, so if you have the /src directory in your project the project path will look like this: /some/path/to/workspace/src/your_project/src/your_code.go.

@cwansart
Copy link
Author

Okay thanks. I may have misunderstood that. Thanks for pointing out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants