Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
cbor-gen
Commits
67a261a1
Unverified
Commit
67a261a1
authored
Mar 03, 2021
by
Steven Allen
Committed by
GitHub
Mar 03, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #52 from Stebalien/doc/document-write-fns
doc: document Write*EncodersToFile functions
parents
f37d2929
baa27e7f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
writefile.go
writefile.go
+10
-0
No files found.
writefile.go
View file @
67a261a1
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment