Skip to content

Commit

Permalink
allow to change FillGaps in decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Safonov committed Sep 2, 2022
1 parent b4c4de2 commit 2ee01f7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions format/postgres/pg_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ const (

func decodePgControl(d *decode.D, in any) any {
d.Endian = decode.LittleEndian
d.Options.FillGaps = false

flavour := in.(format.PostgresIn).Flavour
switch flavour {
Expand Down
1 change: 1 addition & 0 deletions format/postgres/pgheap.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func init() {

func decodePgheap(d *decode.D, in any) any {
d.Endian = decode.LittleEndian
d.Options.FillGaps = false

flavour := in.(format.PostgresIn).Flavour
switch flavour {
Expand Down
2 changes: 1 addition & 1 deletion pkg/decode/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func decode(ctx context.Context, br bitio.ReaderAtSeeker, group Group, opts Opti
}

// TODO: maybe move to Format* funcs?
if opts.FillGaps {
if d.Options.FillGaps {
d.FillGaps(ranges.Range{Start: 0, Len: decodeRange.Len}, "unknown")
}

Expand Down

0 comments on commit 2ee01f7

Please sign in to comment.