1
0
mirror of https://github.com/moby/moby.git synced 2025-10-24 09:13:09 +03:00

Various code-cleanup

remove unnescessary import aliases, brackets, and so on.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2018-05-19 13:38:54 +02:00
parent 0846a02d54
commit f23c00d870
112 changed files with 168 additions and 182 deletions

View File

@@ -273,7 +273,7 @@ func assertNwList(c *check.C, out string, expectNws []string) {
func getNwResource(c *check.C, name string) *types.NetworkResource {
out, _ := dockerCmd(c, "network", "inspect", name)
nr := []types.NetworkResource{}
var nr []types.NetworkResource
err := json.Unmarshal([]byte(out), &nr)
c.Assert(err, check.IsNil)
return &nr[0]
@@ -426,7 +426,7 @@ func (s *DockerSuite) TestDockerNetworkDeleteMultiple(c *check.C) {
func (s *DockerSuite) TestDockerNetworkInspect(c *check.C) {
out, _ := dockerCmd(c, "network", "inspect", "host")
networkResources := []types.NetworkResource{}
var networkResources []types.NetworkResource
err := json.Unmarshal([]byte(out), &networkResources)
c.Assert(err, check.IsNil)
c.Assert(networkResources, checker.HasLen, 1)
@@ -450,7 +450,7 @@ func (s *DockerSuite) TestDockerInspectMultipleNetwork(c *check.C) {
result := dockerCmdWithResult("network", "inspect", "host", "none")
result.Assert(c, icmd.Success)
networkResources := []types.NetworkResource{}
var networkResources []types.NetworkResource
err := json.Unmarshal([]byte(result.Stdout()), &networkResources)
c.Assert(err, check.IsNil)
c.Assert(networkResources, checker.HasLen, 2)
@@ -466,7 +466,7 @@ func (s *DockerSuite) TestDockerInspectMultipleNetworksIncludingNonexistent(c *c
Out: "host",
})
networkResources := []types.NetworkResource{}
var networkResources []types.NetworkResource
err := json.Unmarshal([]byte(result.Stdout()), &networkResources)
c.Assert(err, check.IsNil)
c.Assert(networkResources, checker.HasLen, 1)
@@ -512,7 +512,7 @@ func (s *DockerSuite) TestDockerInspectNetworkWithContainerName(c *check.C) {
}()
out, _ = dockerCmd(c, "network", "inspect", "brNetForInspect")
networkResources := []types.NetworkResource{}
var networkResources []types.NetworkResource
err := json.Unmarshal([]byte(out), &networkResources)
c.Assert(err, check.IsNil)
c.Assert(networkResources, checker.HasLen, 1)
@@ -526,7 +526,7 @@ func (s *DockerSuite) TestDockerInspectNetworkWithContainerName(c *check.C) {
// check whether network inspect works properly
out, _ = dockerCmd(c, "network", "inspect", "brNetForInspect")
newNetRes := []types.NetworkResource{}
var newNetRes []types.NetworkResource
err = json.Unmarshal([]byte(out), &newNetRes)
c.Assert(err, check.IsNil)
c.Assert(newNetRes, checker.HasLen, 1)