Browse Source

Check one is set

Alex Dadgar 6 năm trước cách đây
mục cha
commit
7c1f3f3d75
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      mux.go

+ 2 - 0
mux.go

@@ -65,6 +65,8 @@ func VerifyConfig(config *Config) error {
 	}
 	if config.LogOutput != nil && config.Logger != nil {
 		return fmt.Errorf("both Logger and LogOutput may not be set, select one")
+	} else if config.LogOutput == nil && config.Logger == nil {
+		return fmt.Errorf("one of Logger or LogOutput must be set, select one")
 	}
 	return nil
 }