| 74 | var errForbiddenFieldMaskPaths = errors.DefineInvalidArgument("field_mask_paths", "forbidden path(s) in field mask", "forbidden_paths") |
| 75 | |
| 76 | func forbiddenPaths(requestedPaths []string, allowedPaths map[string]struct{}) []string { |
| 77 | var forbiddenPaths []string |
| 78 | nextRequestedPath: |
| 79 | for _, requestedPath := range requestedPaths { |
| 80 | if _, ok := allowedPaths[requestedPath]; ok { |
| 81 | continue nextRequestedPath |
| 82 | } |
| 83 | forbiddenPaths = append(forbiddenPaths, requestedPath) |
| 84 | } |
| 85 | return forbiddenPaths |
| 86 | } |
| 87 | |
| 88 | func convertError(err error) error { |
| 89 | if ttnErr, ok := errors.From(err); ok { |