示例#1
0
func handleGet(w http.ResponseWriter, r *http.Request) {
	if err := r.ParseForm(); err != nil {
		log.Print(err)
	}
	if len(r.Form) > 0 {
		for k, v := range r.Form {
			data.Set(k, strings.Join(v, " "))
		}
	} else {
		configKeys := data.Keys()
		for _, k := range configKeys {
			fmt.Fprintf(w, "Config[%q] = %q\n", k, data.Get(k))
		}
	}
}
示例#2
0
func Keys() []string {
	return data.Keys()
}