-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextensions.go
43 lines (31 loc) · 836 Bytes
/
extensions.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package model
import "fmt"
func (input *FooInput) String() string {
bar := input.Bar.String()
if !input.Text.Defined {
return "text was not provided, " + bar
}
if input.Text.Value == nil {
return "text is null, " + bar
}
return fmt.Sprintf("text is %q, %s", *input.Text.Value, bar)
}
func (input *BarInput) String() string {
baz := input.Baz.String()
if !input.Count.Defined {
return "count was not provided, " + baz
}
if input.Count.Value == nil {
return "count is null, " + baz
}
return fmt.Sprintf("count is %d, %s", *input.Count.Value, baz)
}
func (input *BazInput) String() string {
if !input.IsSomething.Defined {
return "isSomething was not provided"
}
if input.IsSomething.Value == nil {
return "isSomething is null"
}
return fmt.Sprintf("isSomething is %t", *input.IsSomething.Value)
}