Skip to content

Commit

Permalink
Removed io/ioutil, minimum Go version is now 1.16.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kugelschieber committed Feb 27, 2021
1 parent db65987 commit 02b2a41
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/emvi/logbuch

go 1.16
5 changes: 2 additions & 3 deletions logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package logbuch

import (
"bytes"
"io/ioutil"
"os"
"strings"
"testing"
Expand Down Expand Up @@ -125,7 +124,7 @@ func TestNewLoggerRollingFileAppender(t *testing.T) {
t.Fatal(err)
}

stdFile, err := ioutil.ReadFile("out/1_log.std.txt")
stdFile, err := os.ReadFile("out/1_log.std.txt")

if err != nil {
t.Fatal(err)
Expand All @@ -135,7 +134,7 @@ func TestNewLoggerRollingFileAppender(t *testing.T) {
t.Fatalf("Info log must contain log output, but was: %v", string(stdFile))
}

errFile, err := ioutil.ReadFile("out/1_log.err.txt")
errFile, err := os.ReadFile("out/1_log.err.txt")

if err != nil {
t.Fatal(err)
Expand Down
9 changes: 4 additions & 5 deletions rolling_file_appender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package logbuch

import (
"fmt"
"io/ioutil"
"os"
"testing"
)
Expand Down Expand Up @@ -68,7 +67,7 @@ func TestRollingFileAppender_Write(t *testing.T) {
t.Fatalf("Appender must be closed, but was: %v", err)
}

dir, err := ioutil.ReadDir("out")
dir, err := os.ReadDir("out")

if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -102,7 +101,7 @@ func TestRollingFileAppender_Flush(t *testing.T) {
t.Fatalf("Log output must have been written, but was: %v", err)
}

content, err := ioutil.ReadFile("out/1_log.txt")
content, err := os.ReadFile("out/1_log.txt")

if err != nil {
t.Fatal(err)
Expand All @@ -116,7 +115,7 @@ func TestRollingFileAppender_Flush(t *testing.T) {
t.Fatalf("Log must have been flushed, but was: %v", err)
}

content, err = ioutil.ReadFile("out/1_log.txt")
content, err = os.ReadFile("out/1_log.txt")

if err != nil {
t.Fatal(err)
Expand Down Expand Up @@ -150,7 +149,7 @@ func TestRollingFileAppender_Close(t *testing.T) {
t.Fatal(err)
}

content, err := ioutil.ReadFile("out/1_log.txt")
content, err := os.ReadFile("out/1_log.txt")

if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 02b2a41

Please sign in to comment.