mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
removed references to deprecated ioutil
This commit is contained in:
parent
f5e5e4337e
commit
3cf8bd2ce8
3 changed files with 4 additions and 7 deletions
|
@ -4,7 +4,6 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
@ -146,7 +145,7 @@ func (s *server) getFilePaths(dirName string) ([]string, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fInfo, err := ioutil.ReadDir(dirPath)
|
fInfo, err := os.ReadDir(dirPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
er := fmt.Errorf("error: failed to get filenames in startup folder: %v", err)
|
er := fmt.Errorf("error: failed to get filenames in startup folder: %v", err)
|
||||||
return nil, er
|
return nil, er
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -16,7 +15,7 @@ import (
|
||||||
|
|
||||||
// nodeAuth is the structure that holds both keys and acl's
|
// nodeAuth is the structure that holds both keys and acl's
|
||||||
// that the running steward node shall use for authorization.
|
// that the running steward node shall use for authorization.
|
||||||
//It holds a mutex to use when interacting with the map.
|
// It holds a mutex to use when interacting with the map.
|
||||||
type nodeAuth struct {
|
type nodeAuth struct {
|
||||||
// ACL that defines where a node is allowed to recieve from.
|
// ACL that defines where a node is allowed to recieve from.
|
||||||
nodeAcl *nodeAcl
|
nodeAcl *nodeAcl
|
||||||
|
@ -361,7 +360,7 @@ func (n *nodeAuth) readKeyFile(keyFile string) (ed2519key []byte, b64Key []byte,
|
||||||
}
|
}
|
||||||
defer fh.Close()
|
defer fh.Close()
|
||||||
|
|
||||||
b, err := ioutil.ReadAll(fh)
|
b, err := io.ReadAll(fh)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
er := fmt.Errorf("error: failed to read key file: %v", err)
|
er := fmt.Errorf("error: failed to read key file: %v", err)
|
||||||
return nil, nil, er
|
return nil, nil, er
|
||||||
|
|
3
tui.go
3
tui.go
|
@ -7,7 +7,6 @@ import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -805,7 +804,7 @@ func (t *tui) console(app *tview.Application) tview.Primitive {
|
||||||
// the messages folder.
|
// the messages folder.
|
||||||
func (t *tui) getMessageNames(outputForm *tview.TextView) []string {
|
func (t *tui) getMessageNames(outputForm *tview.TextView) []string {
|
||||||
// Create messages dropdown field.
|
// Create messages dropdown field.
|
||||||
fInfo, err := ioutil.ReadDir("messages")
|
fInfo, err := os.ReadDir("messages")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(outputForm, "error: failed to read files from messages dir\n")
|
fmt.Fprintf(outputForm, "error: failed to read files from messages dir\n")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue