Skip to content

Commit 5c88ae2

Browse files
arschlesAaron Schlesinger
authored andcommitted
feat(cont): add a generic func for extracting to envconfig compatible structs
1 parent a27f5db commit 5c88ae2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

pkg/conf/config.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package conf
2+
3+
import (
4+
"github.com/kelseyhightower/envconfig"
5+
)
6+
7+
func EnvConfig(appName string, conf interface{}) error {
8+
if err := envconfig.Process(appName, conf); err != nil {
9+
return err
10+
}
11+
return nil
12+
}

0 commit comments

Comments
 (0)