aboutsummaryrefslogtreecommitdiff
path: root/hotline/transaction_handlers.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-08 20:36:04 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-06-09 14:05:15 -0700
commitb129b7cbc9fd9a9c11a77e5922861ef08893efa1 (patch)
tree1e3687d1c96fb54bcac1d9c13cdac4297976a758 /hotline/transaction_handlers.go
parent9c44621ee1ca9abfca79c593e80193afd9204c83 (diff)
Convert bespoke methods to io.Reader/io.Writer interfaces
Diffstat (limited to 'hotline/transaction_handlers.go')
-rw-r--r--hotline/transaction_handlers.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/hotline/transaction_handlers.go b/hotline/transaction_handlers.go
index d4269af..793bb74 100644
--- a/hotline/transaction_handlers.go
+++ b/hotline/transaction_handlers.go
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"gopkg.in/yaml.v3"
+ "io"
"math/big"
"os"
"path"
@@ -747,13 +748,12 @@ func HandleListUsers(cc *ClientConn, t *Transaction) (res []Transaction, err err
var userFields []Field
for _, acc := range cc.Server.Accounts {
- b := make([]byte, 0, 100)
- n, err := acc.Read(b)
+ b, err := io.ReadAll(acc)
if err != nil {
return res, err
}
- userFields = append(userFields, NewField(FieldData, b[:n]))
+ userFields = append(userFields, NewField(FieldData, b))
}
res = append(res, cc.NewReply(t, userFields...))