Skip to content

Commit

Permalink
doc: document Write*EncodersToFile functions
Browse files Browse the repository at this point in the history
fixes #51
  • Loading branch information
Stebalien committed Mar 3, 2021
1 parent f37d292 commit baa27e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions writefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit baa27e7

Please sign in to comment.