Skip to content

Commit e98aa5f

Browse files
committed
version 0.11.1
1 parent 79c9bf1 commit e98aa5f

File tree

7 files changed

+15
-21
lines changed

7 files changed

+15
-21
lines changed

internal/test/test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
package test
33

44
import (
5-
"path"
5+
"path/filepath"
66
"runtime"
77
)
88

@@ -13,5 +13,5 @@ func Testdata(name string) string {
1313
return "error"
1414
}
1515

16-
return path.Join(path.Dir(c), "..", "testdata", name)
16+
return filepath.Join(filepath.Dir(c), "..", "testdata", name)
1717
}

internal/zip/zip_utils.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"archive/zip"
66
"io"
77
"os"
8-
"path"
98
"path/filepath"
109
"slices"
1110
)
@@ -21,7 +20,7 @@ func Index(name string) (files []string, err error) {
2120

2221
for _, f := range a.File {
2322
if !f.FileInfo().IsDir() {
24-
files = append(files, filepath.ToSlash(f.Name))
23+
files = append(files, f.Name)
2524
}
2625
}
2726

@@ -40,14 +39,14 @@ func Unzip(name, dir string) (err error) {
4039
defer a.Close()
4140

4241
for _, f := range a.File {
43-
file := path.Join(dir, filepath.ToSlash(f.Name))
42+
file := filepath.Join(dir, f.Name)
4443

4544
if f.FileInfo().IsDir() {
4645
os.MkdirAll(file, os.ModePerm)
4746
continue
4847
}
4948

50-
if err = os.MkdirAll(path.Dir(file), os.ModePerm); err != nil {
49+
if err = os.MkdirAll(filepath.Dir(file), os.ModePerm); err != nil {
5150
return err
5251
}
5352

pkg/ffind/ffind_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package ffind
33

44
import (
55
"os"
6-
"path"
76
"path/filepath"
87
"reflect"
98
"slices"
@@ -15,8 +14,8 @@ import (
1514

1615
var (
1716
tmp, _ = os.MkdirTemp(os.TempDir(), "ffind")
18-
archive = path.Join(filepath.ToSlash(tmp), "archive.zip")
19-
sysroot = path.Join(filepath.ToSlash(tmp), "sysroot")
17+
archive = filepath.Join(tmp, "archive.zip")
18+
sysroot = filepath.Join(tmp, "sysroot")
2019
)
2120

2221
func TestFind(t *testing.T) {

pkg/fmount/dd/dd.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"os"
8-
"path"
98
"path/filepath"
109
"strings"
1110

@@ -49,14 +48,14 @@ func Mount(img, dir string, so bool) (sysroot string, err error) {
4948
}
5049

5150
for i, l := range ls[1:] {
52-
p := path.Join(dir, fmt.Sprintf("p%d", i+1))
51+
p := filepath.Join(dir, fmt.Sprintf("p%d", i+1))
5352

5453
if err := os.MkdirAll(p, mode); err != nil {
5554
sys.Error(err)
5655
continue
5756
}
5857

59-
d := path.Join("/dev", l)
58+
d := filepath.Join("/dev", l)
6059

6160
sp, err := detectMagic(d)
6261

@@ -121,7 +120,7 @@ func Unmount(img string) (err error) {
121120
}
122121

123122
for _, d := range ls[1:] {
124-
if err = umount(path.Join("/dev", d)); err != nil {
123+
if err = umount(filepath.Join("/dev", d)); err != nil {
125124
sys.Error(err)
126125
continue
127126
}

pkg/fmount/fmount.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"os"
8-
"path"
98
"path/filepath"
109
"strings"
1110

@@ -43,7 +42,7 @@ func Extract(img string) (p string, err error) {
4342

4443
dir := filepath.Dir(img)
4544

46-
p = path.Join(dir, i[0])
45+
p = filepath.Join(dir, i[0])
4746

4847
if _, err = os.Stat(p); !os.IsNotExist(err) {
4948
err = errors.New("file already exists")

pkg/windows/system.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package windows
33

44
import (
55
"os"
6-
"path"
76
"path/filepath"
87

98
"github.com/cuhsat/fact/internal/sys"
@@ -14,7 +13,7 @@ func EnumSystem(sysroot string, out chan<- string) {
1413
sysroot = os.ExpandEnv("$SYSTEMDRIVE")
1514
}
1615

17-
root := path.Join(filepath.ToSlash(sysroot), "Windows")
16+
root := filepath.Join(sysroot, "Windows")
1817

1918
if _, err := os.Stat(root); err != nil {
2019
sys.Error(err)
@@ -31,7 +30,7 @@ func EnumSystem(sysroot string, out chan<- string) {
3130
"[Pp]refetch/*.pf",
3231
"[Aa]m[Cc]ompat/[Pp]rograms/[Aa]m[Cc]ache.hve",
3332
} {
34-
files, err := filepath.Glob(path.Join(root, artifact))
33+
files, err := filepath.Glob(filepath.Join(root, artifact))
3534

3635
if err != nil {
3736
sys.Error(err)

pkg/windows/user.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package windows
33

44
import (
55
"os"
6-
"path"
76
"path/filepath"
87

98
"github.com/cuhsat/fact/internal/sys"
@@ -14,7 +13,7 @@ func EnumUsers(sysroot string, out chan<- string) {
1413
sysroot = os.ExpandEnv("$HOMEDRIVE")
1514
}
1615

17-
root := path.Join(filepath.ToSlash(sysroot), "Users")
16+
root := filepath.Join(sysroot, "Users")
1817

1918
if _, err := os.Stat(root); err != nil {
2019
sys.Error(err)
@@ -52,7 +51,7 @@ func EnumUsers(sysroot string, out chan<- string) {
5251
"[Aa]pp[Dd]ata/[Rr]oaming/*/*/[Pp]rofiles/*/places.sqlite",
5352
"[Aa]pp[Dd]ata/[Rr]oaming/*/*/*/[Hh]istory",
5453
} {
55-
files, err := filepath.Glob(path.Join(root, fi.Name(), artifact))
54+
files, err := filepath.Glob(filepath.Join(root, fi.Name(), artifact))
5655

5756
if err != nil {
5857
sys.Error(err)

0 commit comments

Comments
 (0)