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 (#3)
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