From baa27e7fabb9f7edea948b1a62ba0faf792d5137 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Wed, 3 Mar 2021 11:16:45 -0800 Subject: [PATCH] doc: document Write*EncodersToFile functions fixes #51 --- writefile.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/writefile.go b/writefile.go index 6c9a63b..1b369dd 100644 --- a/writefile.go +++ b/writefile.go @@ -8,6 +8,11 @@ import ( "golang.org/x/xerrors" ) +// WriteTupleFileEncodersToFile generates array backed MarshalCBOR and UnmarshalCBOR implementations for the +// given types in the specified file, with the specified package name. +// +// The MarshalCBOR and UnmarshalCBOR implementations will marshal/unmarshal each type's fields as a +// fixed-length CBOR array of field values. func WriteTupleEncodersToFile(fname, pkg string, types ...interface{}) error { buf := new(bytes.Buffer) @@ -50,6 +55,11 @@ func WriteTupleEncodersToFile(fname, pkg string, types ...interface{}) error { return nil } +// WriteMapFileEncodersToFile generates map backed MarshalCBOR and UnmarshalCBOR implementations for +// the given types in the specified file, with the specified package name. +// +// The MarshalCBOR and UnmarshalCBOR implementations will marshal/unmarshal each type's fields as a +// map of field names to field values. func WriteMapEncodersToFile(fname, pkg string, types ...interface{}) error { buf := new(bytes.Buffer)