Rename method Empties to HasEmpties

This commit is contained in:
Mariano Cano 2019-01-14 17:59:31 -08:00
parent cfbb2a6f41
commit 6e620073f5
3 changed files with 4 additions and 4 deletions

View File

@ -117,7 +117,7 @@ func (c *Config) Validate() error {
case c.Address == "":
return errors.New("address cannot be empty")
case c.Root.Empties():
case c.Root.HasEmpties():
return errors.New("root cannot be empty")
case c.IntermediateCert == "":

View File

@ -49,8 +49,8 @@ func (s multiString) First() string {
return ""
}
// Empties returns `true` if any string in the array is empty.
func (s multiString) Empties() bool {
// HasEmpties returns `true` if any string in the array is empty.
func (s multiString) HasEmpties() bool {
if len(s) == 0 {
return true
}

View File

@ -38,7 +38,7 @@ func Test_multiString_Empties(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := tt.s.Empties(); got != tt.want {
if got := tt.s.HasEmpties(); got != tt.want {
t.Errorf("multiString.Empties() = %v, want %v", got, tt.want)
}
})