Browse Source

install.go: swap if branches for readability

Ferdinand Bachmann 5 năm trước cách đây
mục cha
commit
4f35c2c4fe
1 tập tin đã thay đổi với 3 bổ sung3 xóa
  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)