list: getContainers: less indentation
Instead of a huge if {} block, use continue.
Best reviewed with --ignore-all-space.
@@ -127,7 +127,9 @@ func getContainers(context *cli.Context) ([]containerState, error) {
var s []containerState
for _, item := range list {
- if item.IsDir() {
+ if !item.IsDir() {
+ continue
+ }
st, err := os.Stat(filepath.Join(absRoot, item.Name()))
if err != nil {
fatal(err)
@@ -171,6 +173,5 @@ func getContainers(context *cli.Context) ([]containerState, error) {
Owner: owner.Name,
})
}
- }
return s, nil
}
