mirror of
https://github.com/containers/skopeo.git
synced 2025-09-17 15:30:38 +00:00
Add compile-time checks that privateSignature implements json.Marshaler and json.Unmarshaler
This commit is contained in:
@@ -36,6 +36,9 @@ type privateSignature struct {
|
||||
Signature
|
||||
}
|
||||
|
||||
// Compile-time check that privateSignature implements json.Marshaler
|
||||
var _ json.Marshaler = (*privateSignature)(nil)
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (s privateSignature) MarshalJSON() ([]byte, error) {
|
||||
return s.marshalJSONWithVariables(time.Now().UTC().Unix(), signatureCreatorID)
|
||||
@@ -103,6 +106,9 @@ func stringField(m map[string]interface{}, fieldName string) (string, error) {
|
||||
return v, nil
|
||||
}
|
||||
|
||||
// Compile-time check that privateSignature implements json.Unmarshaler
|
||||
var _ json.Unmarshaler = (*privateSignature)(nil)
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface
|
||||
func (s *privateSignature) UnmarshalJSON(data []byte) error {
|
||||
var untyped interface{}
|
||||
|
Reference in New Issue
Block a user