From 13e98d44be25bf48241798d1d84da80d56abdd9b Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Tue, 28 Sep 2021 02:07:01 +0200 Subject: [PATCH] lint: Fix unused bufferRange and toBufferView --- pkg/interp/buffer.go | 5 ----- pkg/interp/interp.go | 14 -------------- 2 files changed, 19 deletions(-) diff --git a/pkg/interp/buffer.go b/pkg/interp/buffer.go index d2e8ed1e..4a99a0eb 100644 --- a/pkg/interp/buffer.go +++ b/pkg/interp/buffer.go @@ -12,11 +12,6 @@ import ( "github.com/wader/fq/pkg/ranges" ) -type bufferRange struct { - bb *bitio.Buffer - r ranges.Range -} - var _ Value = (*BufferView)(nil) var _ ToBuffer = (*BufferView)(nil) diff --git a/pkg/interp/interp.go b/pkg/interp/interp.go index befdc2c6..ff70a5f2 100644 --- a/pkg/interp/interp.go +++ b/pkg/interp/interp.go @@ -26,7 +26,6 @@ import ( "github.com/wader/fq/internal/pos" "github.com/wader/fq/pkg/bitio" "github.com/wader/fq/pkg/decode" - "github.com/wader/fq/pkg/ranges" "github.com/wader/gojq" ) @@ -348,19 +347,6 @@ func toBufferEx(v interface{}, inArray bool) (*bitio.Buffer, error) { } } -func toBufferView(v interface{}) (BufferView, error) { - switch vv := v.(type) { - case ToBufferView: - return vv.ToBufferView() - default: - bb, err := toBuffer(v) - if err != nil { - return BufferView{}, err - } - return BufferView{bb: bb, r: ranges.Range{Len: bb.Len()}, unit: 8}, nil - } -} - func toValue(opts Options, v interface{}) (interface{}, bool) { switch v := v.(type) { case JQValueEx: