Skip to content

Commit

Permalink
Default to YAML when config file has no extension (golangci#2618)
Browse files Browse the repository at this point in the history
  • Loading branch information
donotnoot authored and SeigeC committed Apr 4, 2023
1 parent eb229c9 commit 3b152a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/config/reader.go
Expand Up @@ -46,6 +46,11 @@ func (r *FileReader) Read() error {

if configFile != "" {
viper.SetConfigFile(configFile)

// Assume YAML if the file has no extension.
if filepath.Ext(configFile) == "" {
viper.SetConfigType("yaml")
}
} else {
r.setupConfigFileSearch()
}
Expand Down

0 comments on commit 3b152a1

Please sign in to comment.