• 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/times/times.go
1
// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT.
2
package times
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 Times 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
        NonRequiredDate *UnionNullLong `json:"nonRequiredDate"`
18

19
        RequiredDate int64 `json:"requiredDate"`
20
}
21

22
const TimesAvroCRC64Fingerprint = "\x16\xe8\xc3\xdec`E."
23

UNCOV
24
func NewTimes() *Times {
×
UNCOV
25
        return &Times{}
×
UNCOV
26
}
×
27

28
func DeserializeTimes(r io.Reader) (*Times, error) {
×
29
        t := NewTimes()
×
30
        deser, err := compiler.CompileSchemaBytes([]byte(t.Schema()), []byte(t.Schema()))
×
31
        if err != nil {
×
32
                return nil, err
×
33
        }
×
34

35
        err = vm.Eval(r, deser, t)
×
36
        if err != nil {
×
37
                return nil, err
×
38
        }
×
39
        return t, err
×
40
}
41

UNCOV
42
func DeserializeTimesFromSchema(r io.Reader, schema string) (*Times, error) {
×
UNCOV
43
        t := NewTimes()
×
UNCOV
44

×
UNCOV
45
        deser, err := compiler.CompileSchemaBytes([]byte(schema), []byte(t.Schema()))
×
UNCOV
46
        if err != nil {
×
47
                return nil, err
×
48
        }
×
49

UNCOV
50
        err = vm.Eval(r, deser, t)
×
UNCOV
51
        if err != nil {
×
52
                return nil, err
×
53
        }
×
UNCOV
54
        return t, err
×
55
}
56

UNCOV
57
func writeTimes(r *Times, w io.Writer) error {
×
UNCOV
58
        var err error
×
UNCOV
59
        err = vm.WriteLong(r.AvroWriteTime, w)
×
UNCOV
60
        if err != nil {
×
61
                return err
×
62
        }
×
UNCOV
63
        err = vm.WriteBool(r.AvroDeleted, w)
×
UNCOV
64
        if err != nil {
×
65
                return err
×
66
        }
×
UNCOV
67
        err = writeUnionNullLong(r.NonRequiredDate, w)
×
UNCOV
68
        if err != nil {
×
69
                return err
×
70
        }
×
UNCOV
71
        err = vm.WriteLong(r.RequiredDate, w)
×
UNCOV
72
        if err != nil {
×
73
                return err
×
74
        }
×
UNCOV
75
        return err
×
76
}
77

UNCOV
78
func (r *Times) Serialize(w io.Writer) error {
×
UNCOV
79
        return writeTimes(r, w)
×
UNCOV
80
}
×
81

UNCOV
82
func (r *Times) Schema() string {
×
UNCOV
83
        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\":\"nonRequiredDate\",\"type\":[\"null\",{\"logicalType\":\"timestamp-millis\",\"type\":\"long\"}]},{\"name\":\"requiredDate\",\"type\":{\"logicalType\":\"timestamp-millis\",\"type\":\"long\"}}],\"name\":\"Times\",\"type\":\"record\"}"
×
UNCOV
84
}
×
85

86
func (r *Times) SchemaName() string {
×
87
        return "Times"
×
88
}
×
89

90
func (_ *Times) SetBoolean(v bool)    { panic("Unsupported operation") }
×
91
func (_ *Times) SetInt(v int32)       { panic("Unsupported operation") }
×
92
func (_ *Times) SetLong(v int64)      { panic("Unsupported operation") }
×
93
func (_ *Times) SetFloat(v float32)   { panic("Unsupported operation") }
×
94
func (_ *Times) SetDouble(v float64)  { panic("Unsupported operation") }
×
95
func (_ *Times) SetBytes(v []byte)    { panic("Unsupported operation") }
×
96
func (_ *Times) SetString(v string)   { panic("Unsupported operation") }
×
97
func (_ *Times) SetUnionElem(v int64) { panic("Unsupported operation") }
×
98

UNCOV
99
func (r *Times) Get(i int) types.Field {
×
UNCOV
100
        switch i {
×
UNCOV
101
        case 0:
×
UNCOV
102
                return &types.Long{Target: &r.AvroWriteTime}
×
UNCOV
103
        case 1:
×
UNCOV
104
                return &types.Boolean{Target: &r.AvroDeleted}
×
UNCOV
105
        case 2:
×
UNCOV
106
                r.NonRequiredDate = NewUnionNullLong()
×
UNCOV
107

×
UNCOV
108
                return r.NonRequiredDate
×
UNCOV
109
        case 3:
×
UNCOV
110
                return &types.Long{Target: &r.RequiredDate}
×
111
        }
112
        panic("Unknown field index")
×
113
}
114

115
func (r *Times) SetDefault(i int) {
×
116
        switch i {
×
117
        case 1:
×
118
                r.AvroDeleted = false
×
119
                return
×
120
        }
121
        panic("Unknown field index")
×
122
}
123

UNCOV
124
func (r *Times) NullField(i int) {
×
UNCOV
125
        switch i {
×
UNCOV
126
        case 2:
×
UNCOV
127
                r.NonRequiredDate = nil
×
UNCOV
128
                return
×
129
        }
130
        panic("Not a nullable field index")
×
131
}
132

133
func (_ *Times) AppendMap(key string) types.Field { panic("Unsupported operation") }
×
134
func (_ *Times) AppendArray() types.Field         { panic("Unsupported operation") }
×
135
func (_ *Times) Finalize()                        {}
×
136

137
func (_ *Times) AvroCRC64Fingerprint() []byte {
×
138
        return []byte(TimesAvroCRC64Fingerprint)
×
139
}
×
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