File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,11 +79,6 @@ func (c *Runner) Run(paths []string) error {
7979}
8080
8181func (c * Runner ) walk (root string , stdout * os.File ) error {
82- r , err := os .OpenRoot (root )
83- if err != nil {
84- return err
85- }
86-
8782 return filepath .Walk (root , func (path string , f fs.FileInfo , err error ) error {
8883 if err != nil {
8984 return err
@@ -102,7 +97,10 @@ func (c *Runner) walk(root string, stdout *os.File) error {
10297 return err
10398 }
10499
105- in , err := r .Open (path )
100+ //nolint:gosec // See explanation below.
101+ // `path` contains the `root` but when using `r, err := os.OpenRoot(root)`, this part is not inside the file tree of `r`.
102+ // `filepath.Rel()` can be used but it seems overkill in the context and doesn't work well with a file.
103+ in , err := os .Open (path )
106104 if err != nil {
107105 return err
108106 }
You can’t perform that action at this time.
0 commit comments