vendor: 引入tristate.NewFromBool()

This commit is contained in:
Yousong Zhou
2019-06-20 11:03:37 +00:00
parent 93b95dd9d0
commit b27a2c4180
2 changed files with 10 additions and 2 deletions
Generated
+2 -2
View File
@@ -1754,7 +1754,7 @@
[[projects]]
branch = "master"
digest = "1:04187b7fe2d9788ad901137fd8976272f464bd4080963e7a7f28aa9615d1e47a"
digest = "1:32f6aaab9d4749fc52eb490cf758e955994f2a77b2753976ba93533c3bcf9240"
name = "yunion.io/x/pkg"
packages = [
"errors",
@@ -1788,7 +1788,7 @@
"utils",
]
pruneopts = "UT"
revision = "3afb7f847aad0b254d5768f961d226b24aa24cea"
revision = "aef5d070532643f55f6f60cf79b63b29d95c6ceb"
[[projects]]
branch = "master"
+8
View File
@@ -57,3 +57,11 @@ func (r TriState) IsTrue() bool {
func (r TriState) IsFalse() bool {
return r == False
}
func NewFromBool(b bool) TriState {
if b {
return True
} else {
return False
}
}