MCPcopy Create free account
hub / github.com/SermoDigital/jose / MarshalJSON

Method MarshalJSON

header.go:34–43  ·  view source on GitHub ↗

MarshalJSON implements json.Marshaler for Header.

()

Source from the content-addressed store, hash-verified

32
33// MarshalJSON implements json.Marshaler for Header.
34func (h Header) MarshalJSON() ([]byte, error) {
35 if len(h) == 0 {
36 return nil, nil
37 }
38 b, err := json.Marshal(map[string]interface{}(h))
39 if err != nil {
40 return nil, err
41 }
42 return EncodeEscape(b), nil
43}
44
45// Base64 implements the Encoder interface.
46func (h Header) Base64() ([]byte, error) {

Callers 1

Base64Method · 0.95

Calls 1

EncodeEscapeFunction · 0.85

Tested by

no test coverage detected