(bytes []byte, contentLoc string)
| 157 | } |
| 158 | |
| 159 | func getContentFromJson(bytes []byte, contentLoc string) string { |
| 160 | result := gjson.Get(string(bytes), contentLoc) |
| 161 | content := "" |
| 162 | |
| 163 | if len(result.Str) != 0 { |
| 164 | content += result.Str |
| 165 | } |
| 166 | |
| 167 | if result.IsArray() { |
| 168 | for _, val := range result.Array() { |
| 169 | if len(val.Str) != 0 { |
| 170 | content += val.Str |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | return content |
| 176 | } |
| 177 | |
| 178 | type costLimitError interface { |
| 179 | Error() string |
no test coverage detected