1
1
mirror of https://github.com/wader/fq.git synced 2024-12-25 06:12:30 +03:00

allow to change FillGaps in decoder

This commit is contained in:
Pavel Safonov 2022-09-02 09:03:08 +03:00
parent b4c4de26ca
commit 2ee01f79c2
3 changed files with 3 additions and 1 deletions

View File

@ -56,6 +56,7 @@ const (
func decodePgControl(d *decode.D, in any) any { func decodePgControl(d *decode.D, in any) any {
d.Endian = decode.LittleEndian d.Endian = decode.LittleEndian
d.Options.FillGaps = false
flavour := in.(format.PostgresIn).Flavour flavour := in.(format.PostgresIn).Flavour
switch flavour { switch flavour {

View File

@ -32,6 +32,7 @@ func init() {
func decodePgheap(d *decode.D, in any) any { func decodePgheap(d *decode.D, in any) any {
d.Endian = decode.LittleEndian d.Endian = decode.LittleEndian
d.Options.FillGaps = false
flavour := in.(format.PostgresIn).Flavour flavour := in.(format.PostgresIn).Flavour
switch flavour { switch flavour {

View File

@ -118,7 +118,7 @@ func decode(ctx context.Context, br bitio.ReaderAtSeeker, group Group, opts Opti
} }
// TODO: maybe move to Format* funcs? // TODO: maybe move to Format* funcs?
if opts.FillGaps { if d.Options.FillGaps {
d.FillGaps(ranges.Range{Start: 0, Len: decodeRange.Len}, "unknown") d.FillGaps(ranges.Range{Start: 0, Len: decodeRange.Len}, "unknown")
} }