Diff computes the difference between the keys of the two given maps.
(dst map[string]struct{}, src map[string]struct{})
| 968 | |
| 969 | // Diff computes the difference between the keys of the two given maps. |
| 970 | func Diff(dst map[string]struct{}, src map[string]struct{}) ([]string, []string) { |
| 971 | var add []string |
| 972 | var del []string |
| 973 | |
| 974 | for g := range dst { |
| 975 | if _, ok := src[g]; !ok { |
| 976 | add = append(add, g) |
| 977 | } |
| 978 | } |
| 979 | for g := range src { |
| 980 | if _, ok := dst[g]; !ok { |
| 981 | del = append(del, g) |
| 982 | } |
| 983 | } |
| 984 | |
| 985 | return add, del |
| 986 | } |
| 987 | |
| 988 | // SpanTimer returns a function used to record the duration of the given span. |
| 989 | // It supports both OpenCensus and OpenTelemetry spans |
no outgoing calls
no test coverage detected