mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-22 23:26:39 -08:00
Using bufio reader for Stdin, otherwise the first 3 bytes are consumed and file gets "corrupted" (stdin is not seekable?)
This commit is contained in:
committed by
Simarpreet Singh
parent
9bf16ae1ba
commit
2cb920d5d9
@@ -1,6 +1,7 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
@@ -23,7 +24,7 @@ func TestIsGzip(t *testing.T) {
|
||||
t.Fatalf("unknown error: %s", err)
|
||||
}
|
||||
|
||||
got := IsGzip(f)
|
||||
got := IsGzip(bufio.NewReader(f))
|
||||
if got != tt.want {
|
||||
t.Errorf("got %t, want %t", got, tt.want)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user