Skip to content

Commit

Permalink
remove unused attribute for now
Browse files Browse the repository at this point in the history
  • Loading branch information
letFunny committed Jan 29, 2024
1 parent fad7257 commit 325531b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 42 deletions.
26 changes: 12 additions & 14 deletions internal/slicer/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ import (
)

type ReportEntry struct {
Path string
Mode fs.FileMode
Hash string
Size int
Mutable bool
Slices map[*setup.Slice]bool
Link string
Path string
Mode fs.FileMode
Hash string
Size int
Slices map[*setup.Slice]bool
Link string
}

// Report holds the information about files created when slicing packages.
Expand Down Expand Up @@ -47,13 +46,12 @@ func (r *Report) AddEntry(slice *setup.Slice, entry fsutil.Info) error {
r.Entries[entry.Path] = info
} else {
r.Entries[entry.Path] = ReportEntry{
Path: entry.Path,
Mode: entry.Mode,
Hash: entry.Hash,
Size: entry.Size,
Mutable: false,
Slices: map[*setup.Slice]bool{slice: true},
Link: entry.Link,
Path: entry.Path,
Mode: entry.Mode,
Hash: entry.Hash,
Size: entry.Size,
Slices: map[*setup.Slice]bool{slice: true},
Link: entry.Link,
}
}
return nil
Expand Down
52 changes: 24 additions & 28 deletions internal/slicer/report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,39 +61,36 @@ var testFiles = []struct {
info: sampleDir,
slice: mySlice,
expected: slicer.ReportEntry{
Path: "/root/example",
Mode: fs.ModeDir | 0654,
Hash: "example_hash",
Size: 1234,
Mutable: false,
Slices: map[*setup.Slice]bool{mySlice: true},
Link: "",
Path: "/root/example",
Mode: fs.ModeDir | 0654,
Hash: "example_hash",
Size: 1234,
Slices: map[*setup.Slice]bool{mySlice: true},
Link: "",
},
}, {
summary: "Regular directory added by several slices",
info: sampleDir,
slice: otherSlice,
expected: slicer.ReportEntry{
Path: "/root/example",
Mode: fs.ModeDir | 0654,
Hash: "example_hash",
Size: 1234,
Mutable: false,
Slices: map[*setup.Slice]bool{mySlice: true, otherSlice: true},
Link: "",
Path: "/root/example",
Mode: fs.ModeDir | 0654,
Hash: "example_hash",
Size: 1234,
Slices: map[*setup.Slice]bool{mySlice: true, otherSlice: true},
Link: "",
},
}, {
summary: "Regular file",
info: sampleFile,
slice: mySlice,
expected: slicer.ReportEntry{
Path: "/root/exampleFile",
Mode: 0777,
Hash: "exampleFile_hash",
Size: 5678,
Mutable: false,
Slices: map[*setup.Slice]bool{mySlice: true},
Link: "",
Path: "/root/exampleFile",
Mode: 0777,
Hash: "exampleFile_hash",
Size: 5678,
Slices: map[*setup.Slice]bool{mySlice: true},
Link: "",
},
}, {
summary: "Regular file, error when created by several slices",
Expand All @@ -105,13 +102,12 @@ var testFiles = []struct {
info: sampleLink,
slice: mySlice,
expected: slicer.ReportEntry{
Path: "/root/exampleLink",
Mode: 0777,
Hash: "exampleFile_hash",
Size: 5678,
Mutable: false,
Slices: map[*setup.Slice]bool{mySlice: true},
Link: "/root/exampleFile",
Path: "/root/exampleLink",
Mode: 0777,
Hash: "exampleFile_hash",
Size: 5678,
Slices: map[*setup.Slice]bool{mySlice: true},
Link: "/root/exampleFile",
},
}}

Expand Down

0 comments on commit 325531b

Please sign in to comment.