ioutil: Remove deprecated functions where possible

This commit is contained in:
Jöran Karl
2024-05-30 21:34:11 +02:00
parent 18a81f043c
commit 6e8daa117a
12 changed files with 29 additions and 39 deletions

View File

@@ -4,7 +4,6 @@ import (
"bufio"
"encoding/gob"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
@@ -91,7 +90,7 @@ func CleanConfig() {
// detect incorrectly formatted buffer/ files
buffersPath := filepath.Join(config.ConfigDir, "buffers")
files, err := ioutil.ReadDir(buffersPath)
files, err := os.ReadDir(buffersPath)
if err == nil {
var badFiles []string
var buffer buffer.SerializedBuffer

View File

@@ -4,7 +4,6 @@ import (
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/signal"
@@ -209,7 +208,7 @@ func LoadInput(args []string) []*buffer.Buffer {
// Option 2
// The input is not a terminal, so something is being piped in
// and we should read from stdin
input, err = ioutil.ReadAll(os.Stdin)
input, err = io.ReadAll(os.Stdin)
if err != nil {
screen.TermMessage("Error reading from stdin: ", err)
input = []byte{}