aboutsummaryrefslogtreecommitdiff
path: root/hotline
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2023-04-19 17:00:12 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2023-04-19 17:00:12 -0700
commit7152b7e59b6e30d3025cf5c6386eb2e54b95c139 (patch)
treeec3410fee2709163ee97744ebad63eda6f814ca8 /hotline
parent22c5767f56b55b0327d9ea75a964abf95c684794 (diff)
Replace deprecated iotuil usage
Diffstat (limited to 'hotline')
-rw-r--r--hotline/server.go5
-rw-r--r--hotline/ui.go5
2 files changed, 4 insertions, 6 deletions
diff --git a/hotline/server.go b/hotline/server.go
index f4a2ad4..a3508b2 100644
--- a/hotline/server.go
+++ b/hotline/server.go
@@ -11,7 +11,6 @@ import (
"gopkg.in/yaml.v3"
"io"
"io/fs"
- "io/ioutil"
"math/big"
"math/rand"
"net"
@@ -339,7 +338,7 @@ func (s *Server) writeBanList() error {
if err != nil {
return err
}
- err = ioutil.WriteFile(
+ err = os.WriteFile(
filepath.Join(s.ConfigDir, "Banlist.yaml"),
out,
0666,
@@ -1210,7 +1209,7 @@ func (s *Server) handleFileTransfer(ctx context.Context, rwc io.ReadWriter) erro
return err
}
- if err := receiveFile(rwc, file, ioutil.Discard, ioutil.Discard, fileTransfer.bytesSentCounter); err != nil {
+ if err := receiveFile(rwc, file, io.Discard, io.Discard, fileTransfer.bytesSentCounter); err != nil {
s.Logger.Error(err)
}
diff --git a/hotline/ui.go b/hotline/ui.go
index c005fb4..45c452c 100644
--- a/hotline/ui.go
+++ b/hotline/ui.go
@@ -5,7 +5,6 @@ import (
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
"gopkg.in/yaml.v3"
- "io/ioutil"
"os"
"strconv"
"strings"
@@ -161,7 +160,7 @@ func (ui *UI) renderSettingsForm() *tview.Flex {
// TODO: handle err
}
// TODO: handle err
- err = ioutil.WriteFile(ui.HLClient.cfgPath, out, 0666)
+ err = os.WriteFile(ui.HLClient.cfgPath, out, 0666)
if err != nil {
println(ui.HLClient.cfgPath)
panic(err)
@@ -236,7 +235,7 @@ func (ui *UI) renderJoinServerForm(name, server, login, password, backPage strin
panic(err)
}
- err = ioutil.WriteFile(ui.HLClient.cfgPath, out, 0666)
+ err = os.WriteFile(ui.HLClient.cfgPath, out, 0666)
if err != nil {
panic(err)
}