• 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/timespointers/times_pointers.go
1
// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT.
2
package timespointers
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 TimesPointers 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
        FactCheckClaims []*FactCheckClaims_record `json:"factCheckClaims"`
18

19
        NonRequiredDate *UnionNullLong `json:"nonRequiredDate"`
20

21
        RequiredDate int64 `json:"requiredDate"`
22
}
23

24
const TimesPointersAvroCRC64Fingerprint = "D{$\x8c\xf3'^\xa0"
25

UNCOV
26
func NewTimesPointers() *TimesPointers {
×
UNCOV
27
        return &TimesPointers{}
×
UNCOV
28
}
×
29

30
func DeserializeTimesPointers(r io.Reader) (*TimesPointers, error) {
×
31
        t := NewTimesPointers()
×
32
        deser, err := compiler.CompileSchemaBytes([]byte(t.Schema()), []byte(t.Schema()))
×
33
        if err != nil {
×
34
                return nil, err
×
35
        }
×
36

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

UNCOV
44
func DeserializeTimesPointersFromSchema(r io.Reader, schema string) (*TimesPointers, error) {
×
UNCOV
45
        t := NewTimesPointers()
×
UNCOV
46

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

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

UNCOV
59
func writeTimesPointers(r *TimesPointers, w io.Writer) error {
×
UNCOV
60
        var err error
×
UNCOV
61
        err = vm.WriteLong(r.AvroWriteTime, w)
×
UNCOV
62
        if err != nil {
×
63
                return err
×
64
        }
×
UNCOV
65
        err = vm.WriteBool(r.AvroDeleted, w)
×
UNCOV
66
        if err != nil {
×
67
                return err
×
68
        }
×
UNCOV
69
        err = writeArrayFactCheckClaims_record(r.FactCheckClaims, w)
×
UNCOV
70
        if err != nil {
×
71
                return err
×
72
        }
×
UNCOV
73
        err = writeUnionNullLong(r.NonRequiredDate, w)
×
UNCOV
74
        if err != nil {
×
75
                return err
×
76
        }
×
UNCOV
77
        err = vm.WriteLong(r.RequiredDate, w)
×
UNCOV
78
        if err != nil {
×
79
                return err
×
80
        }
×
UNCOV
81
        return err
×
82
}
83

UNCOV
84
func (r *TimesPointers) Serialize(w io.Writer) error {
×
UNCOV
85
        return writeTimesPointers(r, w)
×
UNCOV
86
}
×
87

UNCOV
88
func (r *TimesPointers) Schema() string {
×
UNCOV
89
        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\":\"factCheckClaims\",\"type\":{\"items\":{\"fields\":[{\"name\":\"appearanceURLs\",\"namespace\":\"factCheckClaims\",\"type\":{\"items\":{\"fields\":[{\"default\":false,\"name\":\"original\",\"namespace\":\"factCheckClaims.appearanceURLs\",\"type\":\"boolean\"},{\"name\":\"url\",\"namespace\":\"factCheckClaims.appearanceURLs\",\"type\":\"string\"}],\"name\":\"appearanceURLs_record\",\"namespace\":\"factCheckClaims.appearanceURLs\",\"type\":\"record\"},\"type\":\"array\"}},{\"name\":\"author\",\"namespace\":\"factCheckClaims\",\"type\":[\"null\",\"string\"]},{\"name\":\"claim\",\"namespace\":\"factCheckClaims\",\"type\":[\"null\",\"string\"]},{\"name\":\"date\",\"namespace\":\"factCheckClaims\",\"type\":[\"null\",\"string\"]},{\"name\":\"rating\",\"namespace\":\"factCheckClaims\",\"type\":[\"null\",\"string\"]}],\"name\":\"factCheckClaims_record\",\"namespace\":\"factCheckClaims\",\"type\":\"record\"},\"type\":\"array\"}},{\"name\":\"nonRequiredDate\",\"type\":[\"null\",{\"logicalType\":\"timestamp-millis\",\"type\":\"long\"}]},{\"name\":\"requiredDate\",\"type\":{\"logicalType\":\"timestamp-millis\",\"type\":\"long\"}}],\"name\":\"TimesPointers\",\"type\":\"record\"}"
×
UNCOV
90
}
×
91

92
func (r *TimesPointers) SchemaName() string {
×
93
        return "TimesPointers"
×
94
}
×
95

96
func (_ *TimesPointers) SetBoolean(v bool)    { panic("Unsupported operation") }
×
97
func (_ *TimesPointers) SetInt(v int32)       { panic("Unsupported operation") }
×
98
func (_ *TimesPointers) SetLong(v int64)      { panic("Unsupported operation") }
×
99
func (_ *TimesPointers) SetFloat(v float32)   { panic("Unsupported operation") }
×
100
func (_ *TimesPointers) SetDouble(v float64)  { panic("Unsupported operation") }
×
101
func (_ *TimesPointers) SetBytes(v []byte)    { panic("Unsupported operation") }
×
102
func (_ *TimesPointers) SetString(v string)   { panic("Unsupported operation") }
×
103
func (_ *TimesPointers) SetUnionElem(v int64) { panic("Unsupported operation") }
×
104

UNCOV
105
func (r *TimesPointers) Get(i int) types.Field {
×
UNCOV
106
        switch i {
×
UNCOV
107
        case 0:
×
UNCOV
108
                return &types.Long{Target: &r.AvroWriteTime}
×
UNCOV
109
        case 1:
×
UNCOV
110
                return &types.Boolean{Target: &r.AvroDeleted}
×
UNCOV
111
        case 2:
×
UNCOV
112
                r.FactCheckClaims = make([]*FactCheckClaims_record, 0)
×
UNCOV
113

×
UNCOV
114
                return &ArrayFactCheckClaims_recordWrapper{Target: &r.FactCheckClaims}
×
UNCOV
115
        case 3:
×
UNCOV
116
                r.NonRequiredDate = NewUnionNullLong()
×
UNCOV
117

×
UNCOV
118
                return r.NonRequiredDate
×
UNCOV
119
        case 4:
×
UNCOV
120
                return &types.Long{Target: &r.RequiredDate}
×
121
        }
122
        panic("Unknown field index")
×
123
}
124

125
func (r *TimesPointers) SetDefault(i int) {
×
126
        switch i {
×
127
        case 1:
×
128
                r.AvroDeleted = false
×
129
                return
×
130
        }
131
        panic("Unknown field index")
×
132
}
133

UNCOV
134
func (r *TimesPointers) NullField(i int) {
×
UNCOV
135
        switch i {
×
UNCOV
136
        case 3:
×
UNCOV
137
                r.NonRequiredDate = nil
×
UNCOV
138
                return
×
139
        }
140
        panic("Not a nullable field index")
×
141
}
142

143
func (_ *TimesPointers) AppendMap(key string) types.Field { panic("Unsupported operation") }
×
144
func (_ *TimesPointers) AppendArray() types.Field         { panic("Unsupported operation") }
×
145
func (_ *TimesPointers) Finalize()                        {}
×
146

147
func (_ *TimesPointers) AvroCRC64Fingerprint() []byte {
×
148
        return []byte(TimesPointersAvroCRC64Fingerprint)
×
149
}
×
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