move implementation to internal/ directory (#828)
This commit is contained in:
committed by
GitHub
parent
b9b9ad10cf
commit
908807bd59
@@ -0,0 +1,19 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user