type config … // defaultConfig returns the default configuration values; it is unaffected by // flags and interactive assignments. func defaultConfig() config { … } var currentCfg … var currentMu … func currentConfig() config { … } func setCurrentConfig(cfg config) { … } type configField … var configFields … var configFieldMap … func init() { … } // fieldPtr returns a pointer to the field identified by f in *cfg. func (cfg *config) fieldPtr(f configField) interface{ … } // get returns the value of field f in cfg. func (cfg *config) get(f configField) string { … } // set sets the value of field f in cfg to value. func (cfg *config) set(f configField, value string) error { … } // isConfigurable returns true if name is either the name of a config field, or // a valid value for a multi-choice config field. func isConfigurable(name string) bool { … } // isBoolConfig returns true if name is either name of a boolean config field, // or a valid value for a multi-choice config field. func isBoolConfig(name string) bool { … } // completeConfig returns the list of configurable names starting with prefix. func completeConfig(prefix string) []string { … } // configure stores the name=value mapping into the current config, correctly // handling the case when name identifies a particular choice in a field. func configure(name, value string) error { … } // resetTransient sets all transient fields in *cfg to their currently // configured values. func (cfg *config) resetTransient() { … } // applyURL updates *cfg based on params. func (cfg *config) applyURL(params url.Values) error { … } // makeURL returns a URL based on initialURL that contains the config contents // as parameters. The second result is true iff a parameter value was changed. func (cfg *config) makeURL(initialURL url.URL) (url.URL, bool) { … }