We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version
$ go version go version go1.20.3 darwin/amd64
Yes, this is the latest version.
go env
$ go env GO111MODULE="auto" GOARCH="amd64" GOBIN="" GOCACHE="/Users/rumia/Library/Caches/go-build" GOENV="/Users/rumia/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/rumia/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/rumia/go" GOPRIVATE="" GOPROXY="https://goproxy.cn,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="go1.20.3" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/rumia/Documents/src/alpacapi/go.mod" GOWORK="" CGO_CFLAGS="-O2 -g" CGO_CPPFLAGS="" CGO_CXXFLAGS="-O2 -g" CGO_FFLAGS="-O2 -g" CGO_LDFLAGS="-O2 -g" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/45/fs2wrr5548dbhlwc0j99_js40000gp/T/go-build815319731=/tmp/go-build -gno-record-gcc-switches -fno-common"
Here is a small test.
package main import ( "net" "net/netip" "testing" ) func TestOnEmptyUDP(t *testing.T) { listener, err := net.ListenUDP("udp", net.UDPAddrFromAddrPort(netip.MustParseAddrPort("127.0.0.1:8888"))) if err != nil { t.Fatal(err) } t.Log("listening on", listener.LocalAddr()) buf := make([]byte, 4096) nzerocnt := 0 go func() { conn, err := net.DialUDP("udp", nil, net.UDPAddrFromAddrPort(netip.MustParseAddrPort("127.0.0.1:8888"))) if err != nil { panic(err) } _, _ = conn.Write(nil) _ = conn.Close() }() for n, remo, err := listener.ReadFromUDP(buf); err == nil; t.Log("recv from", remo) { if n == 0 { nzerocnt++ if nzerocnt >= 4096 { t.Fatal("unexpected zero-loop") } } } }
The test will reach a timeout after 30s.
unexpected zero-loop triggered.
unexpected zero-loop
The text was updated successfully, but these errors were encountered:
i got a mistake. sorry.
Sorry, something went wrong.
No branches or pull requests
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, this is the latest version.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Here is a small test.
What did you expect to see?
The test will reach a timeout after 30s.
What did you see instead?
unexpected zero-loop
triggered.The text was updated successfully, but these errors were encountered: