diff --git a/plugins/ipam/host-local/dns_test.go b/plugins/ipam/host-local/dns_test.go index 4f3a05fa..1b870026 100644 --- a/plugins/ipam/host-local/dns_test.go +++ b/plugins/ipam/host-local/dns_test.go @@ -65,12 +65,11 @@ options four func parse(contents string) (*types.DNS, error) { f, err := ioutil.TempFile("", "host_local_resolv") - defer f.Close() - defer os.Remove(f.Name()) - if err != nil { return nil, err } + defer f.Close() + defer os.Remove(f.Name()) if _, err := f.WriteString(contents); err != nil { return nil, err