Syscall variables undefined

When I try to create the following program on my Mac, I get a build error: undefined: syscall.TCPInfoalthough this variable is clearly documented http://golang.org/pkg/syscall/#TCPInfo

package main

import "syscall"

func main() {
    _ = syscall.TCPInfo{}
}

Here is my version of the go tool.

$ go version
go version go1.3 darwin/amd64

I thought this might be a problem of lack of OS support, so I tried it on http://play.golang.org , but it looks like many document variables are just randomly missing from the package syscall: http://play.golang.org/ p / w3Uk6NaZVy

Did I miss something?

+4
source share
1 answer

The variable specified inside syscall is OS dependent.

, , os :

// +build linux,386 darwin,!cgo

, syscall .

+6

All Articles