Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode committed Jan 14, 2020
1 parent 9efe4c7 commit 9be13bb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/sharedconf/sharedconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type conf struct {
GatewaySVC string `mapstructure:"gatewaysvc"`
}

// Decode decodes the configuration.
func Decode(v interface{}) error {
if err := mapstructure.Decode(v, sharedConf); err != nil {
return err
Expand All @@ -37,13 +38,15 @@ func Decode(v interface{}) error {
return nil
}

// GetJWTSecret returns the package level configured jwt secret if not overwriten.
func GetJWTSecret(val string) string {
if val == "" {
return sharedConf.JWTSecret
}
return val
}

// GetGatewaySVC returns the package level configured gateway service if not overwriten.
func GetGatewaySVC(val string) string {
if val == "" {
return sharedConf.GatewaySVC
Expand Down

0 comments on commit 9be13bb

Please sign in to comment.