Skip to content

Commit

Permalink
Added inputPath validation to semconv-gen (#1986)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyleelin authored Jun 9, 2021
1 parent a113856 commit 7ffe284
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/tools/semconv-gen/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ type config struct {
}

func validateConfig(cfg config) (config, error) {
if cfg.inputPath == "" {
return config{}, errors.New("input path must be provided")
}

if cfg.outputFilename == "" {
cfg.outputFilename = fmt.Sprintf("%s.go", path.Base(cfg.inputPath))
}
Expand Down

0 comments on commit 7ffe284

Please sign in to comment.