package tag

import "github.com/knqyf263/go-plugin/encoding/tag"

Package tag marshals and unmarshals the legacy struct tags as generated by historical versions of protoc-gen-go.

Index

Functions

func Marshal

func Marshal(fd protoreflect.FieldDescriptor, enumName string) string

Marshal encodes the protoreflect.FieldDescriptor as a tag.

The enumName must be provided if the kind is an enum. Historically, the formulation of the enum "name" was the proto package dot-concatenated with the generated Go identifier for the enum type. Depending on the context on how Marshal is called, there are different ways through which that information is determined. As such it is the caller's responsibility to provide a function to obtain that information.

Source Files

tag.go

Version
v0.1.0
Published
Aug 29, 2022
Platform
js/wasm
Imports
5 packages
Last checked
3 days ago

Tools for package owners.