mirror of
https://github.com/zrepl/zrepl.git
synced 2024-11-22 00:13:52 +01:00
20 lines
299 B
Go
20 lines
299 B
Go
package nodefault
|
|
|
|
import "fmt"
|
|
|
|
type Bool struct{ B bool }
|
|
|
|
func (n *Bool) ValidateNoDefault() error {
|
|
if n == nil {
|
|
return fmt.Errorf("must explicitly set `true` or `false`")
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (n *Bool) String() string {
|
|
if n == nil {
|
|
return "unset"
|
|
}
|
|
return fmt.Sprintf("%v", n.B)
|
|
}
|