Skip to content

Commit c8cacd7

Browse files
fix: close file (#521)
* fix: close file * Update changelog.md --------- Co-authored-by: Wayback Archiver <[email protected]>
1 parent f49983f commit c8cacd7

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

cmd/wayback/wayback.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ func readFromFile(s string) (urls []*url.URL) {
143143
if err != nil {
144144
return
145145
}
146+
defer file.Close()
146147
scanner := bufio.NewScanner(file)
147148
for scanner.Scan() {
148149
uri, err := url.Parse(scanner.Text())

docs/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3535
### Fixed
3636
- Load the config file always ([#498](https://github.com/wabarc/wayback/pull/498))
3737
- Signing RPM packages ([#507](https://github.com/wabarc/wayback/pull/507))
38+
- Fix opened file not closing ([#521](https://github.com/wabarc/wayback/pull/521))
3839

3940
## [0.19.1] - 2023-03-21
4041

0 commit comments

Comments
 (0)