mirror of
https://github.com/vishvananda/netlink.git
synced 2025-10-03 23:16:34 +08:00
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:
2
Makefile
2
Makefile
@@ -21,7 +21,7 @@ $(call testdirs,$(DIRS)):
|
|||||||
sudo -E go test -test.parallel 4 -timeout 60s -v github.com/vishvananda/netlink/$@
|
sudo -E go test -test.parallel 4 -timeout 60s -v github.com/vishvananda/netlink/$@
|
||||||
|
|
||||||
$(call fmt,$(call testdirs,$(DIRS))):
|
$(call fmt,$(call testdirs,$(DIRS))):
|
||||||
! gofmt -l $(subst fmt-,,$@)/*.go | grep ''
|
! gofmt -l $(subst fmt-,,$@)/*.go | grep -q .
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
fmt: $(call fmt,$(call testdirs,$(DIRS)))
|
fmt: $(call fmt,$(call testdirs,$(DIRS)))
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
11
nl/nl_unspecified.go
Normal file
11
nl/nl_unspecified.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
// +build !linux
|
||||||
|
|
||||||
|
package nl
|
||||||
|
|
||||||
|
import "encoding/binary"
|
||||||
|
|
||||||
|
var SupportedNlFamilies = []int{}
|
||||||
|
|
||||||
|
func NativeEndian() binary.ByteOrder {
|
||||||
|
return nil
|
||||||
|
}
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -5,3 +5,7 @@ package netlink
|
|||||||
func (r *Route) ListFlags() []string {
|
func (r *Route) ListFlags() []string {
|
||||||
return []string{}
|
return []string{}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (n *NexthopInfo) ListFlags() []string {
|
||||||
|
return []string{}
|
||||||
|
}
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@@ -1,3 +1,5 @@
|
|||||||
|
// +build linux
|
||||||
|
|
||||||
package netlink
|
package netlink
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
Reference in New Issue
Block a user