From b1628639e89afddedda1c9fa829b68f5c597ffdf Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Mon, 19 Mar 2018 19:24:26 +0000 Subject: [PATCH] lint: Fix virtcontainers `staticcheck` errors Correct `staticcheck` linter issues. Signed-off-by: James O. D. Hunt --- virtcontainers/asset_test.go | 2 +- virtcontainers/bridge.go | 2 +- virtcontainers/pkg/hyperstart/hyperstart.go | 2 +- virtcontainers/pkg/hyperstart/multicast.go | 2 +- virtcontainers/pkg/nsenter/nsenter.go | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/virtcontainers/asset_test.go b/virtcontainers/asset_test.go index b9798451ad..132f9f6ba0 100644 --- a/virtcontainers/asset_test.go +++ b/virtcontainers/asset_test.go @@ -112,6 +112,6 @@ func TestAssetNew(t *testing.T) { }, } - a, err = newAsset(p, kernelAsset) + _, err = newAsset(p, kernelAsset) assert.NotNil(err) } diff --git a/virtcontainers/bridge.go b/virtcontainers/bridge.go index c56c6ac58e..dfddd3eee3 100644 --- a/virtcontainers/bridge.go +++ b/virtcontainers/bridge.go @@ -22,7 +22,7 @@ type bridgeType string const ( pciBridge bridgeType = "pci" - pcieBridge = "pcie" + pcieBridge bridgeType = "pcie" ) const pciBridgeMaxCapacity = 30 diff --git a/virtcontainers/pkg/hyperstart/hyperstart.go b/virtcontainers/pkg/hyperstart/hyperstart.go index 991dfc88b3..52401aa449 100644 --- a/virtcontainers/pkg/hyperstart/hyperstart.go +++ b/virtcontainers/pkg/hyperstart/hyperstart.go @@ -485,7 +485,7 @@ func (h *Hyperstart) WaitForPAE(containerID, processID string) (*PAECommand, err msg := <-channel var paeData PAECommand - err = json.Unmarshal(msg.Message, paeData) + err = json.Unmarshal(msg.Message, &paeData) if err != nil { return nil, err } diff --git a/virtcontainers/pkg/hyperstart/multicast.go b/virtcontainers/pkg/hyperstart/multicast.go index ddf1c30378..cedb86eafb 100644 --- a/virtcontainers/pkg/hyperstart/multicast.go +++ b/virtcontainers/pkg/hyperstart/multicast.go @@ -78,7 +78,7 @@ func (m *multicast) buildEventID(containerID, processID string) string { func (m *multicast) sendEvent(msg *DecodedMessage) error { var paeData PAECommand - err := json.Unmarshal(msg.Message, paeData) + err := json.Unmarshal(msg.Message, &paeData) if err != nil { return err } diff --git a/virtcontainers/pkg/nsenter/nsenter.go b/virtcontainers/pkg/nsenter/nsenter.go index 782c25866f..ffcfbfb696 100644 --- a/virtcontainers/pkg/nsenter/nsenter.go +++ b/virtcontainers/pkg/nsenter/nsenter.go @@ -52,10 +52,10 @@ type NSType string // without multithreading issues. const ( NSTypeCGroup NSType = "cgroup" - NSTypeIPC = "ipc" - NSTypeNet = "net" - NSTypePID = "pid" - NSTypeUTS = "uts" + NSTypeIPC NSType = "ipc" + NSTypeNet NSType = "net" + NSTypePID NSType = "pid" + NSTypeUTS NSType = "uts" ) // CloneFlagsTable is exported so that consumers of this package don't need