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

Function parseTag

docstore/driver/codec.go:769–782  ·  view source on GitHub ↗

parseTag interprets docstore struct field tags.

(t reflect.StructTag)

Source from the content-addressed store, hash-verified

767
768// parseTag interprets docstore struct field tags.
769func parseTag(t reflect.StructTag) (name string, keep bool, other any, err error) {
770 var opts []string
771 name, keep, opts = fields.ParseStandardTag("docstore", t)
772 tagOpts := tagOptions{}
773 for _, opt := range opts {
774 switch opt {
775 case "omitempty":
776 tagOpts.omitEmpty = true
777 default:
778 return "", false, nil, gcerr.Newf(gcerr.InvalidArgument, nil, "unknown tag option: %q", opt)
779 }
780 }
781 return name, keep, tagOpts, nil
782}

Callers

nothing calls this directly

Calls 2

ParseStandardTagFunction · 0.92
NewfFunction · 0.92

Tested by

no test coverage detected