1
0
Fork 0
mirror of https://github.com/Luzifer/cloudkeys-go.git synced 2024-11-08 22:20:05 +00:00
cloudkeys-go/config_gae.go
Knut Ahlers cba35eff93
Add fix for config parsing into code
This implements a comment from Luzifer/cloudkeys-go#17 in order not to
have to change the `config.go` when deploying

Signed-off-by: Knut Ahlers <knut@ahlers.me>
2017-12-29 21:49:50 +01:00

21 lines
357 B
Go

// +build appengine
package main
import (
"os"
"github.com/Luzifer/rconfig"
)
func loadConfig() *config {
cfg := &config{}
// Workaround as GAE supplies more parameters than expected.
// This removes all CLI flags for parsing and relies only on parsing
// environment variables.
os.Args = []string{os.Args[0]}
rconfig.Parse(cfg)
return cfg
}