You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on master branch, and it's ok now, i can build, install, debug it.
I'll create a tag as the relase code after code complete, like v1 or v1-x.
Sometimes we need to add or merge functions to released branch(v1 or v2) then build and publish.
When i build code(in released folder), got error: .\main.go:12: dp.NewProp undefined (type dpack.DpackObject has no field or method NewProp).
I know this cause of the type in package does not contain such property, so i'm trying to install the package(in released folder).
Then got error: go install: no install location for D:\released\v1\src\wangxingge.com\Console\dpack: hidden by D:\master\src\wangxingge.com\Console\dpack.
That's mean released source code using master pkg, cause of import code was the same in all gopath.
What did you expect to see?
Build pass and use the right package.
My question is how to use the current path package when build or install correct.
What did you see instead?
The text was updated successfully, but these errors were encountered:
I don't follow what's going on, please provide the complete output of "go env" as requested.
rakyll
changed the title
Multiple gopath has the same code cause of build fail.
cmd/go: multiple gopath has the same code cause of build fail
Jul 29, 2016
@quentinmit
thanks for your reply, following my go env.
C:\Users\WangXingGe>go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\opensource;D:\master;D:\released\v1
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GO15VENDOREXPERIMENT=1
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
btw, i create a virtual machine to build released code, is there other way?
So, GOPATH specifies the order in which packages should be found. Since you have src\customer.com\project_a in D:\master, that is hiding the src\customer.com\project_a that you have in D:\released\v1. If you want to build the package in D:\released\v1, you need to remove D:\master from your search path.
I don't believe there's any bug in the go command here.
Please answer these questions before submitting your issue. Thanks!
go version
)?go version go1.6.2 windows/amd64
go env
)?windows64, i7
First of all, my go path like following(on my computer)
Golang source code
----|---------C:\Go
----|--------------\bin
----|--------------\pkg
----|--------------\src
open source code
----|---------D:\opensource
----|----------------------\bin
----|----------------------\pkg
----|----------------------\src
master code branch (master)
----|---------D:\master
----|------------------\bin
----|------------------\pkg
----|------------------\src\customer.com\project_a
released code branch
----|---------D:\released
----|--------------------\v1
----|-----------------------\bin
----|-----------------------\pkg
----|-----------------------\src\customer.com\project_a
----|--------------------\v2
----|-----------------------\bin
----|-----------------------\pkg
----|-----------------------\src\customer.com\project_a
I'm working on master branch, and it's ok now, i can build, install, debug it.
I'll create a tag as the relase code after code complete, like v1 or v1-x.
Sometimes we need to add or merge functions to released branch(v1 or v2) then build and publish.
When i build code(in released folder), got error: .\main.go:12: dp.NewProp undefined (type dpack.DpackObject has no field or method NewProp).
I know this cause of the type in package does not contain such property, so i'm trying to install the package(in released folder).
Then got error: go install: no install location for D:\released\v1\src\wangxingge.com\Console\dpack: hidden by D:\master\src\wangxingge.com\Console\dpack.
That's mean released source code using master pkg, cause of import code was the same in all gopath.
Build pass and use the right package.
My question is how to use the current path package when build or install correct.
The text was updated successfully, but these errors were encountered: