MCPcopy Create free account
hub / github.com/RussellLuo/validating / Map

Method Map

errors.go:57–66  ·  view source on GitHub ↗

Map converts the given errors to a map[string]Error, where the keys of the map are the field names.

()

Source from the content-addressed store, hash-verified

55// Map converts the given errors to a map[string]Error, where the keys
56// of the map are the field names.
57func (e Errors) Map() map[string]Error {
58 if len(e) == 0 {
59 return nil
60 }
61 m := make(map[string]Error, len(e))
62 for _, err := range e {
63 m[err.Field()] = err
64 }
65 return m
66}
67
68type errorImpl struct {
69 field string

Callers 2

makeSchema1_MapFunction · 0.80
TestMapFunction · 0.80

Calls 1

FieldMethod · 0.65

Tested by 2

makeSchema1_MapFunction · 0.64
TestMapFunction · 0.64