Ver código fonte

install.go: swap if branches for readability

Ferdinand Bachmann 5 anos atrás
pai
commit
4f35c2c4fe
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      install.go

+ 3 - 3
install.go

@@ -1112,11 +1112,11 @@ func buildInstallPkgbuilds(dp *depPool, do *depOrder, srcinfos map[string]*gosrc
 		doAddTarget := func(name string, optional bool) error {
 			pkgdest, ok := pkgdests[name]
 			if !ok {
-				if !optional {
-					return fmt.Errorf("Could not find PKGDEST for: %s", name)
+				if optional {
+					return nil
 				}
 
-				return nil
+				return fmt.Errorf("Could not find PKGDEST for: %s", name)
 			}
 
 			arguments.addTarget(pkgdest)