Misc doc, code refactoring to improve documentation

This commit is contained in:
Bjørn Erik Pedersen
2022-12-30 09:20:58 +01:00
parent 3c51625c71
commit e402d91ee1
47 changed files with 238 additions and 95 deletions

View File

@@ -254,8 +254,10 @@ func init() {
}
}
// Tags is a map of EXIF tags.
type Tags map[string]any
// UnmarshalJSON is for internal use only.
func (v *Tags) UnmarshalJSON(b []byte) error {
vv := make(map[string]any)
if err := tcodec.Unmarshal(b, &vv); err != nil {
@@ -267,6 +269,7 @@ func (v *Tags) UnmarshalJSON(b []byte) error {
return nil
}
// MarshalJSON is for internal use only.
func (v Tags) MarshalJSON() ([]byte, error) {
return tcodec.Marshal(v)
}