fix linters, go to v2

This commit is contained in:
2025-12-06 20:15:05 +01:00
parent 59a771701a
commit 43eb3f67fd
3 changed files with 13 additions and 4 deletions

View File

@@ -58,7 +58,11 @@ func ReadDict(path string) []string {
if err != nil {
panic(err)
}
defer file.Close()
defer func() {
if err := file.Close(); err != nil {
log.Fatal(err)
}
}()
var lines []string
scanner := bufio.NewScanner(file)

4
go.mod
View File

@@ -1,5 +1,5 @@
module codeberg.org/scip/valpass
module codeberg.org/scip/valpass/v2
go 1.22
go 1.24
require github.com/alecthomas/repr v0.4.0 // indirect

View File

@@ -3,6 +3,7 @@ package valpass_test
import (
"bufio"
"fmt"
"log"
"os"
"os/exec"
"strings"
@@ -372,7 +373,11 @@ func ReadDict(path string) []string {
if err != nil {
panic(err)
}
defer file.Close()
defer func() {
if err := file.Close(); err != nil {
log.Fatal(err)
}
}()
var lines []string
scanner := bufio.NewScanner(file)