fix: resolve 5 bugs identified in code review (#3)

This commit is contained in:
tnypxl
2025-11-27 09:58:09 -06:00
committed by GitHub
parent 7569aff6ec
commit 877a7876c0
5 changed files with 18 additions and 24 deletions

View File

@@ -88,6 +88,10 @@ func Load(configPath string) (*Config, error) {
// Validate checks the configuration for any invalid values
func (c *Config) Validate() error {
if len(c.FileExtensions) == 0 && len(c.Sites) == 0 {
return fmt.Errorf("file_extensions or sites must be specified")
}
if c.RequestsPerSecond != nil && *c.RequestsPerSecond <= 0 {
return fmt.Errorf("requests_per_second must be positive")
}