Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Sep 15, 2024
1 parent c82dcf9 commit 274b254
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package log

import (
"fmt"
"io/ioutil"
"io"
"log"
"os"

Expand All @@ -11,7 +11,7 @@ import (
"github.com/carapace-sh/carapace/pkg/ps"
)

var LOG = log.New(ioutil.Discard, "", log.Flags())
var LOG = log.New(io.Discard, "", log.Flags())

func init() {
if !env.Log() {
Expand Down
8 changes: 5 additions & 3 deletions internalActions.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package carapace

import (
"io/ioutil"
"net/url"
"os"
"path/filepath"
Expand Down Expand Up @@ -35,7 +34,7 @@ func actionPath(fileSuffixes []string, dirOnly bool) Action {
}

actualFolder := filepath.ToSlash(filepath.Dir(abs))
files, err := ioutil.ReadDir(actualFolder)
files, err := os.ReadDir(actualFolder)
if err != nil {
return ActionMessage(err.Error())
}
Expand All @@ -48,7 +47,10 @@ func actionPath(fileSuffixes []string, dirOnly bool) Action {
continue
}

resolvedFile := file
resolvedFile, err := file.Info()
if err != nil {
return ActionMessage(err.Error())
}
if resolved, err := filepath.EvalSymlinks(actualFolder + file.Name()); err == nil {
if stat, err := os.Stat(resolved); err == nil {
resolvedFile = stat
Expand Down

0 comments on commit 274b254

Please sign in to comment.