Преглед на файлове

Rename method Empties to HasEmpties

Mariano Cano преди 8 години
родител
ревизия
6e620073f5
променени са 3 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 1 1
      authority/config.go
  2. 2 2
      authority/types.go
  3. 1 1
      authority/types_test.go

+ 1 - 1
authority/config.go

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

+ 2 - 2
authority/types.go

@@ -49,8 +49,8 @@ func (s multiString) First() string {
 	return ""
 	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 {
 	if len(s) == 0 {
 		return true
 		return true
 	}
 	}

+ 1 - 1
authority/types_test.go

@@ -38,7 +38,7 @@ func Test_multiString_Empties(t *testing.T) {
 	}
 	}
 	for _, tt := range tests {
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
 		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)
 				t.Errorf("multiString.Empties() = %v, want %v", got, tt.want)
 			}
 			}
 		})
 		})