mirror of
https://github.com/aquasecurity/trivy.git
synced 2026-02-16 13:43:39 +08:00
fix: use context for analyzers (#9538)
This commit is contained in:
@@ -2,6 +2,7 @@ package packaging
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net/textproto"
|
||||
@@ -30,7 +31,7 @@ func NewParser() *Parser {
|
||||
|
||||
// Parse parses egg and wheel metadata.
|
||||
// e.g. .egg-info/PKG-INFO and dist-info/METADATA
|
||||
func (p *Parser) Parse(r xio.ReadSeekerAt) ([]ftypes.Package, []ftypes.Dependency, error) {
|
||||
func (p *Parser) Parse(_ context.Context, r xio.ReadSeekerAt) ([]ftypes.Package, []ftypes.Dependency, error) {
|
||||
rd := textproto.NewReader(bufio.NewReader(r))
|
||||
h, err := rd.ReadMIMEHeader()
|
||||
if e := textproto.ProtocolError(""); errors.As(err, &e) {
|
||||
|
||||
Reference in New Issue
Block a user