Skip to content

Commit 5f78ea4

Browse files
authored
refactor(fs): remove unused field for CompositeFS (#7195)
Signed-off-by: nikpivkin <[email protected]>
1 parent 5bc662b commit 5f78ea4

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

pkg/fanal/analyzer/analyzer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ func (ag AnalyzerGroup) PostAnalyze(ctx context.Context, compositeFS *CompositeF
504504

505505
// PostAnalyzerFS returns a composite filesystem that contains multiple filesystems for each post-analyzer
506506
func (ag AnalyzerGroup) PostAnalyzerFS() (*CompositeFS, error) {
507-
return NewCompositeFS(ag)
507+
return NewCompositeFS()
508508
}
509509

510510
func (ag AnalyzerGroup) filePatternMatch(analyzerType Type, filePath string) bool {

pkg/fanal/analyzer/analyzer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ func TestAnalyzerGroup_PostAnalyze(t *testing.T) {
614614
require.NoError(t, err)
615615

616616
// Create a virtual filesystem
617-
composite, err := analyzer.NewCompositeFS(analyzer.AnalyzerGroup{})
617+
composite, err := analyzer.NewCompositeFS()
618618
require.NoError(t, err)
619619

620620
mfs := mapfs.New()

pkg/fanal/analyzer/fs.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,17 @@ import (
1515

1616
// CompositeFS contains multiple filesystems for post-analyzers
1717
type CompositeFS struct {
18-
group AnalyzerGroup
1918
dir string
2019
files *sync.Map[Type, *mapfs.FS]
2120
}
2221

23-
func NewCompositeFS(group AnalyzerGroup) (*CompositeFS, error) {
22+
func NewCompositeFS() (*CompositeFS, error) {
2423
tmpDir, err := os.MkdirTemp("", "analyzer-fs-*")
2524
if err != nil {
2625
return nil, xerrors.Errorf("unable to create temporary directory: %w", err)
2726
}
2827

2928
return &CompositeFS{
30-
group: group,
3129
dir: tmpDir,
3230
files: new(sync.Map[Type, *mapfs.FS]),
3331
}, nil

0 commit comments

Comments
 (0)