(body map[string]interface{})
| 352 | } |
| 353 | |
| 354 | func validateBody(body map[string]interface{}) bool { |
| 355 | n, ok := body["NAME"] |
| 356 | if ok { |
| 357 | switch n.(type) { |
| 358 | case string: |
| 359 | default: |
| 360 | fmt.Println("invalid type (NAME), please specify as string") |
| 361 | return false |
| 362 | } |
| 363 | } |
| 364 | t, ok := body["TYPE"] |
| 365 | if ok { |
| 366 | switch t.(type) { |
| 367 | case string: |
| 368 | default: |
| 369 | fmt.Println("invalid type (TYPE), please specify as string") |
| 370 | return false |
| 371 | } |
| 372 | } |
| 373 | return true |
| 374 | } |
no outgoing calls
no test coverage detected