diff options
| author | Jeff Carr <[email protected]> | 2024-11-27 14:08:47 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-27 14:08:47 -0600 |
| commit | 6dd1bba42be7264fb5437d0d7f3a037bc6096fee (patch) | |
| tree | 0de8e85c0979a8edef94eda3fb32e1cd136cc3ff /refs.marshal.go | |
| parent | 2e3e4f98d33d8794a1c8a6aa13e6c9fa92fbcadb (diff) | |
fucking ya
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'refs.marshal.go')
| -rw-r--r-- | refs.marshal.go | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/refs.marshal.go b/refs.marshal.go deleted file mode 100644 index e39d97a..0000000 --- a/refs.marshal.go +++ /dev/null @@ -1,42 +0,0 @@ -package gitpb - -// todo: autogen this -// functions to import and export the protobuf - -import ( - "google.golang.org/protobuf/encoding/protojson" - "google.golang.org/protobuf/encoding/prototext" - "google.golang.org/protobuf/proto" -) - -// human readable JSON -func (r *Refs) FormatJSON() string { - return protojson.Format(r) -} - -// apparently this isn't supposed to be used? -// https://protobuf.dev/reference/go/faq/#unstable-text -// this is a shame because this is much nicer output than JSON Format() -func (r *Refs) FormatTEXT() string { - return prototext.Format(r) -} - -// marshal json -func (r *Refs) MarshalJSON() ([]byte, error) { - return protojson.Marshal(r) -} - -// unmarshal -func (r *Refs) UnmarshalJSON(data []byte) error { - return protojson.Unmarshal(data, r) -} - -// marshal to wire -func (r *Refs) Marshal() ([]byte, error) { - return proto.Marshal(r) -} - -// unmarshal from wire -func (r *Refs) Unmarshal(data []byte) error { - return proto.Unmarshal(data, r) -} |
