mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-15 23:13:22 +00:00
fix: resolve 5 bugs identified in code review
- Fix malformed YAML in config_test.go (incorrect indentation) - Add validation for empty file_extensions in Config.Validate() - Remove obsolete max_depth test case (field no longer exists) - Remove unused global cfg variable in main.go - Fix race condition in ScrapeSites by counting URLs before goroutines - Remove unreachable JavaScript code in scroll script, add proper delay - Standardize file extensions to not include leading dot
This commit is contained in:
@@ -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")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user