• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

GannettDigital / jstransform / 17108478813

20 Aug 2025 07:35PM UTC coverage: 33.717% (-3.4%) from 37.122%
17108478813

Pull #154

github

gannett-ggreer
Use "omitzero" for non-slice/non-pointer structure levels.

"omitempty" never did anything for those types anyway.
Pull Request #154: APIS-8302 - Use "omitzero" for non-slice/non-pointer structure levels.

11 of 23 new or added lines in 8 files covered. (47.83%)

1286 existing lines in 58 files now uncovered.

4833 of 14334 relevant lines covered (33.72%)

25.91 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/generate/avro_test_data/avro/repeats/repeats.go
1
// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT.
2
package repeats
3

4
import (
5
        "github.com/actgardner/gogen-avro/v7/compiler"
6
        "github.com/actgardner/gogen-avro/v7/vm"
7
        "github.com/actgardner/gogen-avro/v7/vm/types"
8
        "io"
9
)
10

11
type Repeats struct {
12
        // The timestamp when this avro data is written. Useful for identifying the newest row of data sharing keys.
13
        AvroWriteTime int64 `json:"AvroWriteTime"`
14
        // This is set to true when the Avro data is recording a delete in the source data.
15
        AvroDeleted bool `json:"AvroDeleted"`
16

17
        Height *UnionNullLong `json:"height"`
18

19
        SomeDateObj *SomeDateObj_record `json:"someDateObj"`
20

21
        Type string `json:"type"`
22

23
        Visible bool `json:"visible"`
24

25
        Width *UnionNullDouble `json:"width"`
26
}
27

28
const RepeatsAvroCRC64Fingerprint = "\xc5L//\xb7\xf4l\xa7"
29

UNCOV
30
func NewRepeats() *Repeats {
×
UNCOV
31
        return &Repeats{}
×
UNCOV
32
}
×
33

34
func DeserializeRepeats(r io.Reader) (*Repeats, error) {
×
35
        t := NewRepeats()
×
36
        deser, err := compiler.CompileSchemaBytes([]byte(t.Schema()), []byte(t.Schema()))
×
37
        if err != nil {
×
38
                return nil, err
×
39
        }
×
40

41
        err = vm.Eval(r, deser, t)
×
42
        if err != nil {
×
43
                return nil, err
×
44
        }
×
45
        return t, err
×
46
}
47

UNCOV
48
func DeserializeRepeatsFromSchema(r io.Reader, schema string) (*Repeats, error) {
×
UNCOV
49
        t := NewRepeats()
×
UNCOV
50

×
UNCOV
51
        deser, err := compiler.CompileSchemaBytes([]byte(schema), []byte(t.Schema()))
×
UNCOV
52
        if err != nil {
×
53
                return nil, err
×
54
        }
×
55

UNCOV
56
        err = vm.Eval(r, deser, t)
×
UNCOV
57
        if err != nil {
×
58
                return nil, err
×
59
        }
×
UNCOV
60
        return t, err
×
61
}
62

UNCOV
63
func writeRepeats(r *Repeats, w io.Writer) error {
×
UNCOV
64
        var err error
×
UNCOV
65
        err = vm.WriteLong(r.AvroWriteTime, w)
×
UNCOV
66
        if err != nil {
×
67
                return err
×
68
        }
×
UNCOV
69
        err = vm.WriteBool(r.AvroDeleted, w)
×
UNCOV
70
        if err != nil {
×
71
                return err
×
72
        }
×
UNCOV
73
        err = writeUnionNullLong(r.Height, w)
×
UNCOV
74
        if err != nil {
×
75
                return err
×
76
        }
×
NEW
77
        err = writeSomeDateObj_record(r.SomeDateObj, w)
×
UNCOV
78
        if err != nil {
×
79
                return err
×
80
        }
×
UNCOV
81
        err = vm.WriteString(r.Type, w)
×
UNCOV
82
        if err != nil {
×
83
                return err
×
84
        }
×
UNCOV
85
        err = vm.WriteBool(r.Visible, w)
×
UNCOV
86
        if err != nil {
×
87
                return err
×
88
        }
×
UNCOV
89
        err = writeUnionNullDouble(r.Width, w)
×
UNCOV
90
        if err != nil {
×
91
                return err
×
92
        }
×
UNCOV
93
        return err
×
94
}
95

UNCOV
96
func (r *Repeats) Serialize(w io.Writer) error {
×
UNCOV
97
        return writeRepeats(r, w)
×
UNCOV
98
}
×
99

UNCOV
100
func (r *Repeats) Schema() string {
×
NEW
101
        return "{\"fields\":[{\"doc\":\"The timestamp when this avro data is written. Useful for identifying the newest row of data sharing keys.\",\"logicalType\":\"timestamp-millis\",\"name\":\"AvroWriteTime\",\"type\":\"long\"},{\"default\":false,\"doc\":\"This is set to true when the Avro data is recording a delete in the source data.\",\"name\":\"AvroDeleted\",\"type\":\"boolean\"},{\"name\":\"height\",\"type\":[\"null\",\"long\"]},{\"name\":\"someDateObj\",\"type\":{\"fields\":[{\"name\":\"type\",\"namespace\":\"someDateObj\",\"type\":\"string\"},{\"default\":false,\"name\":\"visible\",\"namespace\":\"someDateObj\",\"type\":\"boolean\"}],\"name\":\"someDateObj_record\",\"namespace\":\"someDateObj\",\"type\":\"record\"}},{\"name\":\"type\",\"type\":\"string\"},{\"default\":false,\"name\":\"visible\",\"type\":\"boolean\"},{\"name\":\"width\",\"type\":[\"null\",\"double\"]}],\"name\":\"Repeats\",\"type\":\"record\"}"
×
UNCOV
102
}
×
103

104
func (r *Repeats) SchemaName() string {
×
105
        return "Repeats"
×
106
}
×
107

108
func (_ *Repeats) SetBoolean(v bool)    { panic("Unsupported operation") }
×
109
func (_ *Repeats) SetInt(v int32)       { panic("Unsupported operation") }
×
110
func (_ *Repeats) SetLong(v int64)      { panic("Unsupported operation") }
×
111
func (_ *Repeats) SetFloat(v float32)   { panic("Unsupported operation") }
×
112
func (_ *Repeats) SetDouble(v float64)  { panic("Unsupported operation") }
×
113
func (_ *Repeats) SetBytes(v []byte)    { panic("Unsupported operation") }
×
114
func (_ *Repeats) SetString(v string)   { panic("Unsupported operation") }
×
115
func (_ *Repeats) SetUnionElem(v int64) { panic("Unsupported operation") }
×
116

UNCOV
117
func (r *Repeats) Get(i int) types.Field {
×
UNCOV
118
        switch i {
×
UNCOV
119
        case 0:
×
UNCOV
120
                return &types.Long{Target: &r.AvroWriteTime}
×
UNCOV
121
        case 1:
×
UNCOV
122
                return &types.Boolean{Target: &r.AvroDeleted}
×
UNCOV
123
        case 2:
×
UNCOV
124
                r.Height = NewUnionNullLong()
×
UNCOV
125

×
UNCOV
126
                return r.Height
×
UNCOV
127
        case 3:
×
NEW
128
                r.SomeDateObj = NewSomeDateObj_record()
×
UNCOV
129

×
UNCOV
130
                return r.SomeDateObj
×
UNCOV
131
        case 4:
×
UNCOV
132
                return &types.String{Target: &r.Type}
×
UNCOV
133
        case 5:
×
UNCOV
134
                return &types.Boolean{Target: &r.Visible}
×
UNCOV
135
        case 6:
×
UNCOV
136
                r.Width = NewUnionNullDouble()
×
UNCOV
137

×
UNCOV
138
                return r.Width
×
139
        }
140
        panic("Unknown field index")
×
141
}
142

143
func (r *Repeats) SetDefault(i int) {
×
144
        switch i {
×
145
        case 1:
×
146
                r.AvroDeleted = false
×
147
                return
×
148
        case 5:
×
149
                r.Visible = false
×
150
                return
×
151
        }
152
        panic("Unknown field index")
×
153
}
154

155
func (r *Repeats) NullField(i int) {
×
156
        switch i {
×
157
        case 2:
×
158
                r.Height = nil
×
159
                return
×
160
        case 6:
×
161
                r.Width = nil
×
162
                return
×
163
        }
164
        panic("Not a nullable field index")
×
165
}
166

167
func (_ *Repeats) AppendMap(key string) types.Field { panic("Unsupported operation") }
×
168
func (_ *Repeats) AppendArray() types.Field         { panic("Unsupported operation") }
×
169
func (_ *Repeats) Finalize()                        {}
×
170

171
func (_ *Repeats) AvroCRC64Fingerprint() []byte {
×
172
        return []byte(RepeatsAvroCRC64Fingerprint)
×
173
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc