MCPcopy
hub / github.com/cloudfoundry/cli / NewNullString

Function NewNullString

types/null_string.go:12–21  ·  view source on GitHub ↗
(optionalValue ...string)

Source from the content-addressed store, hash-verified

10}
11
12func 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
23func (n NullString) MarshalJSON() ([]byte, error) {
24 if n.IsSet {

Calls

no outgoing calls

Tested by

no test coverage detected