// Add updates the Values by including a properly formatted form value to data Values.
Add updates the Values by including a properly formatted form value to data Values.
// Add updates the Values by including a properly formatted form value to data Values .
func (v *Values) Add(key, value string) {
	if v.keyIndex[key] == 0 {
		v.values.Set(key, value)
		v.keyIndex[key]++
		return
	}
	if v.keyIndex[key] == 1 {
		val := v.values.Get(key)
		v.values.Del(key)
		k := key + ".0"
		v.values.Add(k, val)
	}
	keyIdx := fmt.Sprintf("%s.%d", key, v.keyIndex[key])
	v.keyIndex[key]++
	v.values.Set(keyIdx, value)
}
func ( v * Values ) Add ( key , value string ) { if v . keyIndex [ key ] == 0 { v . values . Set ( key , value ) v . keyIndex [ key ] ++ return } if v . keyIndex [ key ] == 1 { val := v . values . Get ( key ) v . values . Del ( key ) k := key + " " v . values . Add ( k , val ) } keyIdx := fmt . Sprintf ( " " , key , v . keyIndex [ key ] ) v . keyIndex [ key ] ++ v . values . Set ( keyIdx , value ) }
Add updates the Values by including a properly formatted form value to data Values.
Add updates the Values by including a properly formatted form value to data Values .