(fp FieldPath)
| 589 | } |
| 590 | |
| 591 | func parseFieldPath(fp FieldPath) ([]string, error) { |
| 592 | if len(fp) == 0 { |
| 593 | return nil, gcerr.Newf(gcerr.InvalidArgument, nil, "empty field path") |
| 594 | } |
| 595 | if !utf8.ValidString(string(fp)) { |
| 596 | return nil, gcerr.Newf(gcerr.InvalidArgument, nil, "invalid UTF-8 field path %q", fp) |
| 597 | } |
| 598 | parts := strings.Split(string(fp), ".") |
| 599 | if slices.Contains(parts, "") { |
| 600 | return nil, gcerr.Newf(gcerr.InvalidArgument, nil, "empty component in field path %q", fp) |
| 601 | } |
| 602 | return parts, nil |
| 603 | } |
| 604 | |
| 605 | // RevisionToString converts a document revision to a string. The returned |
| 606 | // string should be treated as opaque; its only use is to provide a serialized |
no test coverage detected