summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2025-04-06 23:07:53 +0200
committerMartin Fischer <martin@push-f.com>2025-04-13 23:18:01 +0200
commit43c782b50fe9c5acbfd04139337873326015e27d (patch)
tree93b311b98a53f22aa21409a8ece1f446885997fa
parent35275699ade84abefbf0b1a6c82882d8d470c8ad (diff)
refactor: stop using deprecated io/ioutil package
-rw-r--r--lex-serve/main.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/lex-serve/main.go b/lex-serve/main.go
index 416104f..07dba19 100644
--- a/lex-serve/main.go
+++ b/lex-serve/main.go
@@ -5,7 +5,6 @@ import (
"embed"
"encoding/json"
"html/template"
- "io/ioutil"
"log/slog"
"net"
"net/http"
@@ -39,13 +38,13 @@ func main() {
os.Exit(1)
}
- lawFiles, err := ioutil.ReadDir("laws")
+ lawFiles, err := os.ReadDir("laws")
if err != nil {
log.Error("failed to read laws/ directory", Error(err))
os.Exit(1)
}
for _, file := range lawFiles {
- text, err := ioutil.ReadFile("laws/" + file.Name())
+ text, err := os.ReadFile("laws/" + file.Name())
if err != nil {
log.Error("failed to read file", Error(err), "path", "laws/"+file.Name())
os.Exit(1)