MCPcopy Create free account
hub / github.com/google/go-cloud / parseFieldPath

Function parseFieldPath

docstore/docstore.go:591–603  ·  view source on GitHub ↗
(fp FieldPath)

Source from the content-addressed store, hash-verified

589}
590
591func 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

Callers 3

WhereMethod · 0.85
parseFieldPathsFunction · 0.85
toDriverModsFunction · 0.85

Calls 1

NewfFunction · 0.92

Tested by

no test coverage detected