code: func (dec *Decoder) RegisterCustomType(fn DecodeCustomTypeFunc, types []interface{}, fields []interface{}) *Decoder {
  	if dec.customTypes == nil {
  		dec.customTypes = make(map[reflect.Type]*decodeCustomType, 100)
  	}
  	lenFields := len(fields)
  	for i := range types {
  		typ := reflect.TypeOf(types[i])
  		if dec.customTypes[typ] == nil {
  			dec.customTypes[typ] = &decodeCustomType{fun: fn, fields: make([]*decodeCustomTypeField, 0, lenFields)}
  		}
  		if lenFields > 0 {
  			for j := range fields {
  				val := reflect.ValueOf(fields[j])
  				field := &decodeCustomTypeField{field: val, fun: fn}
  				dec.customTypes[typ].fields = append(dec.customTypes[typ].fields, field)
  			}
  		}
  	}
  	return dec
  }
docs: // RegisterCustomType registers a functions for decoding custom types.