The unmarshaller first marshals the value into a string. Then it trims any space around it and lowercase it for normaliztion. The method does not and should not validate the value within accepted enums.
(b []byte)
| 31 | // trims any space around it and lowercase it for normaliztion. The |
| 32 | // method does not and should not validate the value within accepted enums. |
| 33 | func (c *ACMEChallenge) UnmarshalJSON(b []byte) error { |
| 34 | var s string |
| 35 | if err := json.Unmarshal(b, &s); err != nil { |
| 36 | return err |
| 37 | } |
| 38 | *c = ACMEChallenge(strings.ToLower(strings.TrimSpace(s))) |
| 39 | return nil |
| 40 | } |
| 41 | |
| 42 | // String returns a string representation of the challenge. |
| 43 | func (c ACMEChallenge) String() string { |
nothing calls this directly
no test coverage detected