Return the argument name and type for query methods. Should only be used in the context of method arguments.
()
| 55 | // Return the argument name and type for query methods. Should only be used in |
| 56 | // the context of method arguments. |
| 57 | func (v QueryValue) Pairs() []Argument { |
| 58 | if v.isEmpty() { |
| 59 | return nil |
| 60 | } |
| 61 | if !v.EmitStruct() && v.IsStruct() { |
| 62 | var out []Argument |
| 63 | for _, f := range v.Struct.Fields { |
| 64 | out = append(out, Argument{ |
| 65 | Name: escape(toLowerCase(f.Name)), |
| 66 | Type: f.Type, |
| 67 | }) |
| 68 | } |
| 69 | return out |
| 70 | } |
| 71 | return []Argument{ |
| 72 | { |
| 73 | Name: escape(v.Name), |
| 74 | Type: v.DefineType(), |
| 75 | }, |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func (v QueryValue) SlicePair() string { |
| 80 | if v.isEmpty() { |
no test coverage detected