Skip to content

Commit e48936a

Browse files
committed
update
1 parent 67c329f commit e48936a

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

file.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,15 +451,14 @@ func Unzip(srcPath, destPath string) error {
451451
}
452452

453453
// Write data to file
454-
fw, err := os.Create(filepath.Join(destPath, f.Name))
454+
var fw *os.File
455+
fw, err = os.Create(filepath.Join(destPath, f.Name))
455456
if err != nil {
456457
return err
457458
}
458459
_, err = io.Copy(fw, rc)
459-
460-
if fw != nil {
461-
fw.Close()
462-
}
460+
fw.Close()
461+
rc.Close()
463462
if err != nil {
464463
return err
465464
}

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,21 @@ require (
77
github.com/admpub/fsnotify v1.7.0
88
github.com/admpub/pp v0.0.7
99
github.com/francoispqt/gojay v1.2.13
10-
github.com/goccy/go-json v0.10.4
10+
github.com/goccy/go-json v0.10.5
1111
github.com/hashicorp/go-version v1.7.0
1212
github.com/json-iterator/go v1.1.12
1313
github.com/stretchr/testify v1.9.0
14-
golang.org/x/crypto v0.31.0
15-
golang.org/x/text v0.21.0
14+
golang.org/x/crypto v0.33.0
15+
golang.org/x/text v0.22.0
1616
)
1717

1818
require (
1919
github.com/davecgh/go-spew v1.1.1 // indirect
20-
github.com/mattn/go-colorable v0.1.13 // indirect
20+
github.com/mattn/go-colorable v0.1.14 // indirect
2121
github.com/mattn/go-isatty v0.0.20 // indirect
2222
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
2323
github.com/modern-go/reflect2 v1.0.2 // indirect
2424
github.com/pmezard/go-difflib v1.0.0 // indirect
25-
golang.org/x/sys v0.28.0 // indirect
25+
golang.org/x/sys v0.30.0 // indirect
2626
gopkg.in/yaml.v3 v3.0.1 // indirect
2727
)

0 commit comments

Comments
 (0)