-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for "json" struct field tag
To unmarshal a CBOR map into a struct, unmarshal matches CBOR map keys to the keys in the following priority: 1. "cbor" key in struct field tag, 2. "json" key in struct field tag, 3. struct field name. Marshalling a struct follows the same rule. // Field appears in CBOR as key "a". Field int `cbor:"a"` // Field appears in CBOR as key "a". Field int `json:"a"` // Field appears in CBOR as key "b". Field int `json:"a" cbor:"b"` // Field is ignored. Field int `json:"a" cbor:"-"` // Field appears in CBOR as key "Field". Field int
- Loading branch information
Faye Amacker
committed
Sep 11, 2019
1 parent
799c64b
commit 8117beb
Showing
7 changed files
with
189 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters