I'm trying to debug a problem in the go runtime and wished to use the 
debuglog.go features found in 
https://github.com/golang/go/blob/master/src/runtime/debuglog.go

However,  when I follow the example 
here https://github.com/golang/go/issues/59600#issuecomment-1515040287 

d := dlog() if d != nil { d.s("foo") d.i(42) d.end() }

I can't build the Go source code

Building Go cmd/dist using /usr/local/go (go1.22.0 darwin/amd64)
Building Go toolchain1 using /usr/local/go
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1

*Invalid operation d != nil mismatched types (dlogger and untyped nil)*

I changed the code to remove the *d != nil *check, and was able to build 
the go source code, but when I build my app with this go source code using 
the *-tags debuglog*

bin/go build -tags debuglog -o myapp *.go

it is not printing any debug logs to my terminal

Can any suggest anything?

Thank you
  

invalid operation: d != nil (mismatched types dlogger and untyped nil)

Building Go cmd/dist using /usr/local/go. (go1.22.0 darwin/amd64)

Building Go toolchain1 using /usr/local/go.

Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.

Building Go cmd/dist using /usr/local/go. (go1.22.0 darwin/amd64)

Building Go toolchain1 using /usr/local/go.

Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.

Building Go cmd/dist using /usr/local/go. (go1.22.0 darwin/amd64)

Building Go toolchain1 using /usr/local/go.

Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.

Building Go cmd/dist using /usr/local/go. (go1.22.0 darwin/amd64)

Building Go toolchain1 using /usr/local/go.

Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.

Building Go cmd/dist using /usr/local/go. (go1.22.0 darwin/amd64)

Building Go toolchain1 using /usr/local/go.

Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.

Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.

 invalid operation: d != nil (mismatched types dlogger and untyped nil)

-- 
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/9d476777-34f5-4f42-8f44-5d92546d6b6cn%40googlegroups.com.

Reply via email to