// config returns a function that returns the current global named config // value. func config(client *client.Client) func(string) string { var asValue string return func(name string) string { switch strings.ToLower(name) { case "asnumber": if asValue == "" { if asn, err := client.Config().GetGlobalASNumber(); err != nil { asValue = "unknown" } else { asValue = asn.String() } } return asValue } panic("unhandled config type") } }