pkg/fall: make Zero and Root vars not funcs (#1367)

These can be just vars. Think that was intended as well.
This commit is contained in:
Miek Gieben 2018-01-09 22:29:19 +00:00 committed by GitHub
parent a19ea63d3a
commit cced1a4c12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 52 deletions

View file

@ -28,7 +28,7 @@ func (f *F) setZones(zones []string) {
// SetZonesFromArgs sets zones in f to the passed value or to "." if the slice is empty.
func (f *F) SetZonesFromArgs(zones []string) {
if len(zones) == 0 {
f.setZones(Root().Zones)
f.setZones(Root.Zones)
return
}
f.setZones(zones)
@ -50,9 +50,9 @@ func (f F) Equal(g F) bool {
// Zero returns a zero valued F.
var Zero = func() F {
return F{[]string{}}
}
}()
// Root returns F set to only ".".
var Root = func() F {
return F{[]string{"."}}
}
}()