From 6dd1bba42be7264fb5437d0d7f3a037bc6096fee Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 27 Nov 2024 14:08:47 -0600 Subject: fucking ya Signed-off-by: Jeff Carr --- refs.marshal.go | 42 ------------------------------------------ 1 file changed, 42 deletions(-) delete mode 100644 refs.marshal.go (limited to 'refs.marshal.go') 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) -} -- cgit v1.2.3