Remove naked return
Signed-off-by: yangshukui <yangshukui@huawei.com>
This commit is contained in:
parent
3be7f87b1b
commit
4584a4e762
8
spec.go
8
spec.go
|
@ -299,7 +299,7 @@ func loadSpec(cPath, rPath string) (spec *specs.LinuxSpec, rspec *specs.LinuxRun
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return nil, nil, fmt.Errorf("JSON specification file at %s not found", cPath)
|
return nil, nil, fmt.Errorf("JSON specification file at %s not found", cPath)
|
||||||
}
|
}
|
||||||
return
|
return spec, rspec, err
|
||||||
}
|
}
|
||||||
defer cf.Close()
|
defer cf.Close()
|
||||||
|
|
||||||
|
@ -308,15 +308,15 @@ func loadSpec(cPath, rPath string) (spec *specs.LinuxSpec, rspec *specs.LinuxRun
|
||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
return nil, nil, fmt.Errorf("JSON runtime config file at %s not found", rPath)
|
return nil, nil, fmt.Errorf("JSON runtime config file at %s not found", rPath)
|
||||||
}
|
}
|
||||||
return
|
return spec, rspec, err
|
||||||
}
|
}
|
||||||
defer rf.Close()
|
defer rf.Close()
|
||||||
|
|
||||||
if err = json.NewDecoder(cf).Decode(&spec); err != nil {
|
if err = json.NewDecoder(cf).Decode(&spec); err != nil {
|
||||||
return
|
return spec, rspec, err
|
||||||
}
|
}
|
||||||
if err = json.NewDecoder(rf).Decode(&rspec); err != nil {
|
if err = json.NewDecoder(rf).Decode(&rspec); err != nil {
|
||||||
return
|
return spec, rspec, err
|
||||||
}
|
}
|
||||||
return spec, rspec, checkSpecVersion(spec)
|
return spec, rspec, checkSpecVersion(spec)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue