From 36a2849809e2365ef1e8f302a3d401ca9cd23ee7 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 9 Jan 2025 21:39:47 -0600 Subject: [PATCH] Notes added by 'git notes append' --- 40c340c6267aa53164804aad6ed988183fc42d3f | 55 ++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/40c340c6267aa53164804aad6ed988183fc42d3f b/40c340c6267aa53164804aad6ed988183fc42d3f index 97d1ac7..4a9b3eb 100644 --- a/40c340c6267aa53164804aad6ed988183fc42d3f +++ b/40c340c6267aa53164804aad6ed988183fc42d3f @@ -609,3 +609,58 @@ func file_forgeConfig_proto_init() { } // `autogen:patch.marshal.pb.go` + +// Code generated by go.wit.com/apps/autogenpb DO NOT EDIT. +// This file was autogenerated with autogenpb v0.0.37-30-g805d3cd 2025.01.09_2100 +// go install go.wit.com/apps/autogenpb@latest +// +// define which structs (messages) you want to use in the .proto file +// Then sort.pb.go and marshal.pb.go files are autogenerated +// +// autogenpb uses it and has an example .proto file with instructions +// + +package forgepb + +import ( + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/encoding/prototext" + "google.golang.org/protobuf/proto" +) + +// human readable JSON +func (v *Patchs) FormatJSON() string { + return protojson.Format(v) +} + +// marshal json +func (v *Patchs) MarshalJSON() ([]byte, error) { + return protojson.Marshal(v) +} + +// unmarshal json +func (v *Patchs) UnmarshalJSON(data []byte) error { + return protojson.Unmarshal(data, v) +} + +// apparently this isn't stable, but it's awesomely better +// https://protobuf.dev/reference/go/faq/#unstable-text +// it's brilliant for config files! +func (v *Patchs) FormatTEXT() string { + return prototext.Format(v) +} + +// unmarshalTEXT. This reads the .text config file back in after the user edits it +func (v *Patchs) UnmarshalTEXT(data []byte) error { + return prototext.Unmarshal(data, v) +} + +// marshal to wire. This is called winning. +func (v *Patchs) Marshal() ([]byte, error) { + return proto.Marshal(v) +} + +// unmarshal from wire. You have won. +func (v *Patchs) Unmarshal(data []byte) error { + return proto.Unmarshal(data, v) +}