Closed powellnorma closed 1 year ago
No. No idea.
It doesn't happen when using the default resolver, though - Weird
Are you able to reproduce it? I use go1.21.4
Will you have any time/desire to investigate this? Do you think it could be a bug in the go runtime somehow?
No, I can't reproduce it.
$ go version
go version go1.21.4 darwin/amd64
Hm, I tested it in another linux environment: go version go1.19.5 linux/amd64
In there go run main.go also-redirect-log DoT
also generates an empty /tmp/test.log
file.
So I guess it is linux only. Do you by any chance have a linux system you could test this with?
In case this library is not doing anything "low level" regarding logging / file handle manipulation, it must come from golang.org/x/net
, as that is the only dependency used here, right?
That dependency is a test dependency only. And no, the library is not doing anything weird.
Got resolved - It was due to garbage collection of the overwritten os.Stderr (see https://github.com/golang/go/issues/64555#issuecomment-1842115871)
I found a weird bug, do you have any idea what may causes this?
main.go:
Results:
So when using both
also-redirect-log
(log.SetOutput
) andDoT
(NewDoTResolver
), the panic is not logged to the file.