onlyIn lists the fields in a that b doesn't ask for. A new object is listed once, without the fields inside it.
(a, b map[string]bool)
| 190 | // onlyIn lists the fields in a that b doesn't ask for. A new object is listed |
| 191 | // once, without the fields inside it. |
| 192 | func onlyIn(a, b map[string]bool) []string { |
| 193 | var paths []string |
| 194 | for path := range a { |
| 195 | if b[path] { |
| 196 | continue |
| 197 | } |
| 198 | parent := path[:strings.LastIndex(path, ".")] |
| 199 | if parent == "data" || b[parent] { |
| 200 | paths = append(paths, path) |
| 201 | } |
| 202 | } |
| 203 | sort.Strings(paths) |
| 204 | return paths |
| 205 | } |