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

The Build System is Weird! #24388

Closed
Dentrax opened this issue Mar 14, 2018 · 2 comments
Closed

The Build System is Weird! #24388

Dentrax opened this issue Mar 14, 2018 · 2 comments

Comments

@Dentrax
Copy link

Dentrax commented Mar 14, 2018

What version of Go are you using (go version)?

go1.10 windows/amd64

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Furkan\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Furkan\Documents\Go Projects\
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Furkan\AppData\Local\Temp\go-build858009470=/tmp/go-build -gno-record-gcc-switches

What did you expect to see?

We know, the default Workspace system is : https://golang.org/doc/code.html#Workspaces

I've been trying to get build with Go for about 2 hours... That's exactly how I was trying:

$GOPATH -> Main Workspace Path

How it should be Workspace Folder ? Like this;

$GOPATH
-libs
-projects (Original version is 'src'. It's very misunderstood. I was putting the normal '.go' files in here -,-)
--Project-A
---.git/
---bin/
---src/
--Project-B
---.git/
---bin/
---src/
-...

What did you see instead?

Even if you are not going to change the Workspace system in the future, please change the name of the 'src' folder to like 'projects'

You can also add a function that will create an easy way with a command such as 'go init'. What exactly is it doing ? If the GOPATH is set and I execute the 'go init project-a' command ; The build system should automatically crate project and Workspace adjustment if it is not set.

For example:
$GOPATH = C:\go-works
When I ran : "go init Project-A", The Workspace folder must be set as follows;
$GOPATH
-libs
-projects
--Project-A
---bin/
---src/

Even if you don't think about it, the current system is in a very misunderstood state. Please change it. Thank you. <3

@mvdan
Copy link
Member

mvdan commented Mar 14, 2018

We can't change $GOPATH/src to $GOPATH/projects; that would break backwards compatibility and lots of people's setups.

However, what you're after is likely not using $GOPATH at all - see #17271.

@mvdan
Copy link
Member

mvdan commented Mar 14, 2018

I'll take the thumbs up as you agreeing with my comment above; closing.

@mvdan mvdan closed this as completed Mar 14, 2018
@golang golang locked and limited conversation to collaborators Mar 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants