(optionalValue ...string)
| 10 | } |
| 11 | |
| 12 | func NewNullString(optionalValue ...string) NullString { |
| 13 | switch len(optionalValue) { |
| 14 | case 0: |
| 15 | return NullString{IsSet: false} |
| 16 | case 1: |
| 17 | return NullString{Value: optionalValue[0], IsSet: true} |
| 18 | default: |
| 19 | panic("Too many strings passed to nullable string constructor") |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | func (n NullString) MarshalJSON() ([]byte, error) { |
| 24 | if n.IsSet { |
no outgoing calls
no test coverage detected