getParamUnion(keyValArrAnnots, keyValArrParams, key) returns the union of parameters listed under annotations (keyValArrAnnots, using key) and bound parameters (keyValArrParams). Bound parameters will be denoted with a prefixed "*", and finalized bound parameters (can't be changed by user) will be d
(keyValArrAnnots whisk.KeyValueArr, keyValArrParams whisk.KeyValueArr, key string)
| 428 | // a prefixed "*", and finalized bound parameters (can't be changed by |
| 429 | // user) will be denoted by a prefixed "**". |
| 430 | func getParamUnion(keyValArrAnnots whisk.KeyValueArr, keyValArrParams whisk.KeyValueArr, key string) []string { |
| 431 | var res []string |
| 432 | tag := "*" |
| 433 | if getValueBool(keyValArrAnnots, "final") { |
| 434 | tag = "**" |
| 435 | } |
| 436 | boundParams := getKeys(keyValArrParams) |
| 437 | annotatedParams := getChildValueStrings(keyValArrAnnots, "parameters", key) |
| 438 | res = append(boundParams, annotatedParams...) // Create union of boundParams and annotatedParams with duplication |
| 439 | for i := 0; i < len(res); i++ { |
| 440 | for j := i + 1; j < len(res); j++ { |
| 441 | if res[i] == res[j] { |
| 442 | res = append(res[:j], res[j+1:]...) // Remove duplicate entry |
| 443 | } |
| 444 | } |
| 445 | } |
| 446 | sort.Strings(res) |
| 447 | res = tagBoundParams(boundParams, res, tag) |
| 448 | return res |
| 449 | } |
| 450 | |
| 451 | // tagBoundParams(boundParams, paramUnion, tag) returns the list paramUnion with |
| 452 | // all strings listed under boundParams set with a prefix tag. |
no test coverage detected