mirror of
https://github.com/vishvananda/netlink
synced 2024-12-28 09:32:17 +00:00
c21bda41e9
Commitec93726159
("Adds strings translation methods") broke non-Linux builds by relying on unix constants that are only declared on the linux platform in the upstream x/sys/unix package. Other platforms report undefined variables, such as the following: $ GOOS=darwin go build . # github.com/vishvananda/netlink ./route.go:17:7: undefined: SCOPE_UNIVERSE ./route.go:19:7: undefined: SCOPE_SITE ./route.go:21:7: undefined: SCOPE_LINK ./route.go:23:7: undefined: SCOPE_HOST ./route.go:25:7: undefined: SCOPE_NOWHERE ./route.go:55:7: undefined: unix.RTPROT_BABEL ./route.go:57:7: undefined: unix.RTPROT_BGP ./route.go:59:7: undefined: unix.RTPROT_BIRD ./route.go:61:7: undefined: unix.RTPROT_BOOT ./route.go:63:7: undefined: unix.RTPROT_DHCP ./route.go:63:7: too many errors Move the platform-specific implementations to platform-specific files and add stubs to satisfy other platforms. Fixes:ec93726159
("Adds strings translation methods") Signed-off-by: Joe Stringer <joe@cilium.io>
22 lines
307 B
Go
22 lines
307 B
Go
// +build !linux
|
|
|
|
package netlink
|
|
|
|
import "strconv"
|
|
|
|
func (r *Route) ListFlags() []string {
|
|
return []string{}
|
|
}
|
|
|
|
func (n *NexthopInfo) ListFlags() []string {
|
|
return []string{}
|
|
}
|
|
|
|
func (s Scope) String() string {
|
|
return "unknown"
|
|
}
|
|
|
|
func (p RouteProtocol) String() string {
|
|
return strconv.Itoa(int(p))
|
|
}
|