On Thursday, June 27, 2019 at 1:44:20 AM UTC+2, Gert wrote:
>
> On Thursday, June 27, 2019 at 12:11:58 AM UTC+2, Ian Lance Taylor wrote:
>>
>> On Wed, Jun 26, 2019 at 1:39 PM Gert <gert....@gmail.com> wrote: 
>> > 
>> > Hmm trying to work on the src code of `go doc` but every time I try to 
>> compile a ./doc binary it uses other src code, it doesn't look in the 
>> current directory am in, I have to force it `go build main.go` what going 
>> on here? 
>> > 
>> > gert@gert ~/Desktop/go/src/cmd/doc:master> go build 
>> > 
>> > gert@gert ~/Desktop/go/src/cmd/doc:master> ls 
>> > dirs.go         doc             doc_test.go     main.go         pkg.go 
>>          testdata 
>> > 
>> > I can see a doc binary getting created but its not build form the 
>> main.go in current directory, I deliberately put a syntax error in main? 
>> > 
>> > gert@gert ~/Desktop/go/src/cmd/doc:master> go build main.go 
>> > # command-line-arguments 
>> > ./main.go:78:2: syntax error: unexpected --, expecting } 
>> > 
>> > gert@gert ~/Desktop/go/src/cmd/doc:master> go env 
>> > GOARCH="amd64" 
>> > GOBIN="/Users/gert/bin" 
>> > GOCACHE="/Users/gert/Library/Caches/go-build" 
>> > GOEXE="" 
>> > GOFLAGS="" 
>> > GOHOSTARCH="amd64" 
>> > GOHOSTOS="darwin" 
>> > GOOS="darwin" 
>> > GOPATH="/Users/gert/go" 
>> > GOPROXY="" 
>> > GORACE="" 
>> > GOROOT="/usr/local/go" 
>> > GOTMPDIR="" 
>> > GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" 
>> > GCCGO="gccgo" 
>> > CC="clang" 
>> > CXX="clang++" 
>> > CGO_ENABLED="1" 
>> > GOMOD="/Users/gert/Desktop/go/src/cmd/go.mod" 
>> > CGO_CFLAGS="-g -O2" 
>> > CGO_CPPFLAGS="" 
>> > CGO_CXXFLAGS="-g -O2" 
>> > CGO_FFLAGS="-g -O2" 
>> > CGO_LDFLAGS="-g -O2" 
>> > PKG_CONFIG="pkg-config" 
>> > GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics 
>> -Qunused-arguments -fmessage-length=0 
>> -fdebug-prefix-map=/var/folders/dv/8tlwvjr91zjdyq4rk14lkkfm0000gn/T/go-build645754300=/tmp/go-build
>>  
>> -gno-record-gcc-switches -fno-common" 
>>
>>
>> This may be related to https://golang.org/issue/32724.  Is your 
>> cmd/doc directory underneath the directory displayed by `go env 
>> GOROOT`? 
>>
>> Ian 
>>
>
> Nope `~/Desktop/go/src/cmd/doc` (git clone of go itself) is not in GOROOT 
> nor in GOPATH using a seperate bootstrap go version devel +f938b9b33b Wed 
> Jun 26 20:26:48 2019 +0000 darwin/amd64 in /usr/local/go
>
> So I assume if I match GOROOT with the repo as in git clone everything in 
> /usr/local/go and bootstrap using a /usr/local/go1 then i can work on go 
> doc. Going to try that now
>

Yep working when I develop in GOROOT directly, but not sure if this 
intended by design that you can only develop on go src itself that way.

-- 
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 on the web visit 
https://groups.google.com/d/msgid/golang-nuts/e4baf719-a801-4a68-8141-637200da0405%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to