Skip to content

Commit

Permalink
bugfix: read env when appsettings.yaml not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
fanhousanbu committed Mar 4, 2024
1 parent 6bc58bd commit c486d0a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ func getConf() *Conf {
// getConfiguration
func getConfiguration(filePath *string) *Conf {
if file, err := os.ReadFile(*filePath); err != nil {
return mappingEnvToConf(nil)
return mappingEnvToConf(
&Conf{
Jwt: JWT{},
},
)
} else {
c := Conf{}
err := yaml.Unmarshal(file, &c)
Expand Down

0 comments on commit c486d0a

Please sign in to comment.