Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
The package updated and now shows new warnings that had to be corrected
to let the CI pass

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
  • Loading branch information
Flavio Crisciani committed Sep 20, 2017
1 parent 6d09846 commit 9e5748a
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 56 deletions.
6 changes: 1 addition & 5 deletions cmd/dnet/dnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,7 @@ func startTestDriver() error {
return err
}

if err := ioutil.WriteFile("/etc/docker/plugins/test.spec", []byte(server.URL), 0644); err != nil {
return err
}

return nil
return ioutil.WriteFile("/etc/docker/plugins/test.spec", []byte(server.URL), 0644)
}

func newDnetConnection(val string) (*dnetConnection, error) {
Expand Down
6 changes: 1 addition & 5 deletions drivers/bridge/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -763,11 +763,7 @@ func (d *driver) createNetwork(config *networkConfiguration) error {

// Apply the prepared list of steps, and abort at the first error.
bridgeSetup.queueStep(setupDeviceUp)
if err = bridgeSetup.apply(); err != nil {
return err
}

return nil
return bridgeSetup.apply()
}

func (d *driver) DeleteNetwork(nid string) error {
Expand Down
11 changes: 2 additions & 9 deletions drivers/bridge/setup_ip_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ func setupIPTablesInternal(bridgeIface string, addr net.Addr, icc, ipmasq, hairp
}

// Set Accept on all non-intercontainer outgoing packets.
if err := programChainRule(outRule, "ACCEPT NON_ICC OUTGOING", enable); err != nil {
return err
}

return nil
return programChainRule(outRule, "ACCEPT NON_ICC OUTGOING", enable)
}

func programChainRule(rule iptRule, ruleDescr string, insert bool) error {
Expand Down Expand Up @@ -304,10 +300,7 @@ func setupInternalNetworkRules(bridgeIface string, addr net.Addr, icc, insert bo
return err
}
// Set Inter Container Communication.
if err := setIcc(bridgeIface, icc, insert); err != nil {
return err
}
return nil
return setIcc(bridgeIface, icc, insert)
}

func clearEndpointConnections(nlh *netlink.Handle, ep *bridgeEndpoint) {
Expand Down
11 changes: 2 additions & 9 deletions drivers/overlay/ov_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,22 +144,15 @@ func (d *driver) deleteEndpointFromStore(e *endpoint) error {
return fmt.Errorf("overlay local store not initialized, ep not deleted")
}

if err := d.localStore.DeleteObjectAtomic(e); err != nil {
return err
}

return nil
return d.localStore.DeleteObjectAtomic(e)
}

func (d *driver) writeEndpointToStore(e *endpoint) error {
if d.localStore == nil {
return fmt.Errorf("overlay local store not initialized, ep not added")
}

if err := d.localStore.PutObjectAtomic(e); err != nil {
return err
}
return nil
return d.localStore.PutObjectAtomic(e)
}

func (ep *endpoint) DataScope() string {
Expand Down
11 changes: 2 additions & 9 deletions drivers/solaris/overlay/ov_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,22 +134,15 @@ func (d *driver) deleteEndpointFromStore(e *endpoint) error {
return fmt.Errorf("overlay local store not initialized, ep not deleted")
}

if err := d.localStore.DeleteObjectAtomic(e); err != nil {
return err
}

return nil
return d.localStore.DeleteObjectAtomic(e)
}

func (d *driver) writeEndpointToStore(e *endpoint) error {
if d.localStore == nil {
return fmt.Errorf("overlay local store not initialized, ep not added")
}

if err := d.localStore.PutObjectAtomic(e); err != nil {
return err
}
return nil
return d.localStore.PutObjectAtomic(e)
}

func (ep *endpoint) DataScope() string {
Expand Down
6 changes: 1 addition & 5 deletions endpoint_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,7 @@ func (ep *endpoint) Info() EndpointInfo {
return ep
}

if epi := sb.getEndpoint(ep.ID()); epi != nil {
return epi
}

return nil
return sb.getEndpoint(ep.ID())
}

func (ep *endpoint) Iface() InterfaceInfo {
Expand Down
11 changes: 2 additions & 9 deletions iptables/iptables.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,7 @@ func (c *ChainInfo) Forward(action Action, ip net.IP, port int, proto, destAddr
"--dport", strconv.Itoa(destPort),
"-j", "MASQUERADE",
}
if err := ProgramRule(Nat, "POSTROUTING", action, args); err != nil {
return err
}

return nil
return ProgramRule(Nat, "POSTROUTING", action, args)
}

// Link adds reciprocal ACCEPT rule for two supplied IP addresses.
Expand All @@ -301,10 +297,7 @@ func (c *ChainInfo) Link(action Action, ip1, ip2 net.IP, port int, proto string,
// reverse
args[7], args[9] = args[9], args[7]
args[10] = "--sport"
if err := ProgramRule(Filter, c.Name, action, args); err != nil {
return err
}
return nil
return ProgramRule(Filter, c.Name, action, args)
}

// ProgramRule adds the rule specified by args only if the
Expand Down
6 changes: 1 addition & 5 deletions sandbox_dns_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,7 @@ func (sb *sandbox) setupResolutionFiles() error {
return err
}

if err := sb.setupDNS(); err != nil {
return err
}

return nil
return sb.setupDNS()
}

func (sb *sandbox) buildHostsFile() error {
Expand Down

0 comments on commit 9e5748a

Please sign in to comment.