Fix compilation errors for non linux platforms.

The go get command and make both fail when executed on
non-linux platforms. Modified it so that there are no
compilation errors when developing in such an
environment.
This commit is contained in:
Aithal
2017-02-20 09:34:32 -08:00
committed by Vish Ishaya
parent a1d6c19f19
commit dedc638a06
17 changed files with 44 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ $(call testdirs,$(DIRS)):
sudo -E go test -test.parallel 4 -timeout 60s -v github.com/vishvananda/netlink/$@
$(call fmt,$(call testdirs,$(DIRS))):
! gofmt -l $(subst fmt-,,$@)/*.go | grep ''
! gofmt -l $(subst fmt-,,$@)/*.go | grep -q .
.PHONY: fmt
fmt: $(call fmt,$(call testdirs,$(DIRS)))

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

11
nl/nl_unspecified.go Normal file
View File

@@ -0,0 +1,11 @@
// +build !linux
package nl
import "encoding/binary"
var SupportedNlFamilies = []int{}
func NativeEndian() binary.ByteOrder {
return nil
}

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import "testing"

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -5,3 +5,7 @@ package netlink
func (r *Route) ListFlags() []string {
return []string{}
}
func (n *NexthopInfo) ListFlags() []string {
return []string{}
}

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (

View File

@@ -1,3 +1,5 @@
// +build linux
package netlink
import (