(r interface{})
| 128 | } |
| 129 | |
| 130 | func (f *ExpandJSON) postProcessJSON(r interface{}) []byte { |
| 131 | switch typedValue := r.(type) { |
| 132 | case json.Number: |
| 133 | return []byte(typedValue) |
| 134 | case string: |
| 135 | return []byte(typedValue) |
| 136 | case bool: |
| 137 | if typedValue { |
| 138 | return f.trueFalseValues[trueIdx] |
| 139 | } else { |
| 140 | return f.trueFalseValues[falseIdx] |
| 141 | } |
| 142 | default: |
| 143 | val, _ := json.Marshal(typedValue) |
| 144 | return val |
| 145 | } |
| 146 | } |