func (config *Config) checkValidAuth() error { authConfig := config.OptionalString("auth", "") mode, err := auth.FromConfig(authConfig) if err == nil { auth.SetMode(mode) } return err }
func main() { flag.Parse() mode, err := auth.FromEnv() if err != nil { log.Fatal(err) } auth.SetMode(mode) ws := webserver.New() ws.HandleFunc("/", handleRoot) ws.HandleFunc("/camli/sig/", handleCamliSig) ws.Serve() }