-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Closed
Labels
FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.
Description
What version of Go are you using (go version
)?
$ go version go version go1.13.4 linux/amd64
Does this issue reproduce with the latest release?
Yes, there no changes.
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/user1/.cache/go-build" GOENV="/home/user1/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/user1/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/lib/go-1.13" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/lib/go-1.13/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" 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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build325102545=/tmp/go-build -gno-record-gcc-switches"
What did you do?
Recommendation from https://golang.org/src/syscall/syscall_unix.go?s=2815:2833#L115 , use errors.Is
, while checking error from syscall. But some os.Err*
, not handled in syscall.Errno.Is
. In the example I try to check for os.ErrInvalid
, and always get false. I think it's little obscure, all errors defined in os/errors.go
need be check.
package main
import (
"syscall"
"net"
"log"
"errors"
"os"
)
const TCP_FASTOPEN_CONNECT = 30
func main() {
addr, err := net.ResolveTCPAddr("tcp", "127.0.0.1:1337")
if err != nil {
log.Fatal(err)
}
li, err := net.ListenTCP("tcp", addr)
if err != nil {
log.Fatal(err)
}
conn, err := li.SyscallConn()
if err != nil {
log.Fatal(err)
}
conn.Control(func(fd uintptr) {
err = syscall.SetsockoptInt(int(fd), syscall.SOL_TCP, TCP_FASTOPEN_CONNECT, 5)
if errors.Is(err, os.ErrInvalid) {
log.Fatal("true ", err)
} else {
log.Fatal("false ", err) // false "invalid argument", the same as os.ErrInvalid
}
})
}
What did you expect to see?
Actual check with:
if errors.Is(err, os.ErrInvalid) {
}
What did you see instead?
Always false.
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.