INNER CODE UNIT · Go
getConfig
brexhq/substation · cmd/aws/lambda/substation/main.go:36
func getConfig(ctx context.Context) (io.Reader, error) {
buf := new(bytes.Buffer)
cfg, found := os.LookupEnv("SUBSTATION_CONFIG")
if !found {
return nil, fmt.Errorf("no config found")
}
path, err := file.Get(ctx, cfg)
defer os.Remove(path)
if err != nil {
return nil, err
}
conf, err := os.Open(path)
if err != nil {
return nil, err