(t NamespaceType, path string)
| 104 | } |
| 105 | |
| 106 | func (n *Namespaces) Add(t NamespaceType, path string) { |
| 107 | i := n.index(t) |
| 108 | if i == -1 { |
| 109 | *n = append(*n, Namespace{Type: t, Path: path}) |
| 110 | return |
| 111 | } |
| 112 | (*n)[i].Path = path |
| 113 | } |
| 114 | |
| 115 | func (n *Namespaces) index(t NamespaceType) int { |
| 116 | for i, ns := range *n { |