Skip to content
This repository was archived by the owner on Jan 21, 2020. It is now read-only.

Commit a02e62b

Browse files
author
David Chung
authored
fix lint errors from updated go lint (#692)
Signed-off-by: David Chung <[email protected]>
1 parent ecd2bea commit a02e62b

File tree

7 files changed

+7
-31
lines changed

7 files changed

+7
-31
lines changed

examples/instance/docker/instance.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,7 @@ func (p dockerInstancePlugin) Destroy(id instance.ID, dc instance.Context) error
347347
cli := p.client
348348
ctx := context.Background()
349349
log.Debugf("Destroying container ID %s", string(id))
350-
if err := cli.ContainerRemove(ctx, string(id), options); err != nil {
351-
return err
352-
}
353-
return nil
350+
return cli.ContainerRemove(ctx, string(id), options)
354351
}
355352

356353
func describeGroupRequest(namespaceTags, tags map[string]string) *apitypes.ContainerListOptions {

examples/instance/vagrant/instance.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,7 @@ func (v vagrantPlugin) Destroy(id instance.ID, context instance.Context) error {
206206
fmt.Println("Vagrant destroy failed: ", err)
207207
}
208208

209-
if err := os.RemoveAll(machineDir); err != nil {
210-
return err
211-
}
212-
213-
return nil
209+
return os.RemoveAll(machineDir)
214210
}
215211

216212
// DescribeInstances returns descriptions of all instances matching all of the provided tags.

pkg/fsm/set.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,7 @@ func (s *Set) handleEvent(tid int64, event *event) error {
454454
s.bystate[next][instance.id] = instance
455455

456456
// visits limit trigger
457-
if err := s.processVisitLimit(tid, instance, next); err != nil {
458-
return err
459-
}
460-
return nil
457+
return s.processVisitLimit(tid, instance, next)
461458
}
462459

463460
func (s *Set) tid() int64 {

pkg/plugin/flavor/kubernetes/flavor.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,7 @@ func (s *baseFlavor) Validate(flavorProperties *types.Any, allocation group_type
115115
}
116116
}
117117

118-
if err := validateIDsAndAttachments(allocation.LogicalIDs, spec.Attachments); err != nil {
119-
return err
120-
}
121-
return nil
118+
return validateIDsAndAttachments(allocation.LogicalIDs, spec.Attachments)
122119
}
123120

124121
// Healthy determines whether an instance is healthy.

pkg/plugin/flavor/swarm/flavor.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,7 @@ func (s *baseFlavor) Validate(flavorProperties *types.Any, allocation group_type
159159
}
160160
}
161161

162-
if err := validateIDsAndAttachments(allocation.LogicalIDs, spec.Attachments); err != nil {
163-
return err
164-
}
165-
166-
return nil
162+
return validateIDsAndAttachments(allocation.LogicalIDs, spec.Attachments)
167163
}
168164

169165
// Healthy determines whether an instance is healthy. This is determined by whether it has successfully joined the

pkg/plugin/instance/packet/plugin.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,7 @@ func (p *plugin) VendorInfo() *spi.VendorInfo {
6060
// Validate performs local validation on a provision request.
6161
func (p *plugin) Validate(req *types.Any) error {
6262
properties := &Properties{}
63-
if err := req.Decode(&properties); err != nil {
64-
return err
65-
}
66-
67-
return nil
63+
return req.Decode(&properties)
6864
}
6965

7066
// Label labels the instance

pkg/x/remoteboot/remoteboot.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,7 @@ func (c *BootController) serveHTTP() error {
310310

311311
httpHandler := http.FileServer(http.Dir(docroot))
312312

313-
if err = http.ListenAndServe(":80", httpHandler); err != nil {
314-
return err
315-
}
316-
return nil
313+
return http.ListenAndServe(":80", httpHandler)
317314
}
318315

319316
//////////////////////////////

0 commit comments

Comments
 (0)