SetParserDecoder allow globally change the option of form decoder, update decoderPool
(parserConfig ParserConfig)
| 51 | |
| 52 | // SetParserDecoder allow globally change the option of form decoder, update decoderPool |
| 53 | func SetParserDecoder(parserConfig ParserConfig) { |
| 54 | decoderPoolMu.Lock() |
| 55 | defer decoderPoolMu.Unlock() |
| 56 | |
| 57 | for _, tag := range tags { |
| 58 | decoderPoolMap[tag] = &sync.Pool{New: func() any { |
| 59 | return decoderBuilder(tag, parserConfig) |
| 60 | }} |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func decoderBuilder(aliasTag string, parserConfig ParserConfig) any { |
| 65 | decoder := schema.NewDecoder() |