Skip to content

Commit

Permalink
Fix: Test error on go1.13, go1.14 and go1.15.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoger committed May 3, 2021
1 parent e1d5c76 commit 077edf6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions file_writer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
)

func TestNewFileWriter(t *testing.T) {
dir, err := os.MkdirTemp("", "TestNewFileWriter.*")
if err != nil {
dir := filepath.Join(os.TempDir(), strconv.FormatInt(time.Now().UnixNano(), 10), "TestNewFileWriter")
if err := os.MkdirAll(dir, 0766); err != nil {
t.Fatal(err)
}
defer func() {
Expand All @@ -50,8 +52,8 @@ func TestNewFileWriter(t *testing.T) {
}

func TestMustNewFileWriter(t *testing.T) {
dir, err := os.MkdirTemp("", "TestNewFileWriter.*")
if err != nil {
dir := filepath.Join(os.TempDir(), strconv.FormatInt(time.Now().UnixNano(), 10), "TestMustNewFileWriter")
if err := os.MkdirAll(dir, 0766); err != nil {
t.Fatal(err)
}
defer func() {
Expand All @@ -77,8 +79,8 @@ func TestMustNewFileWriter(t *testing.T) {
}

func TestFileWriter(t *testing.T) {
dir, err := os.MkdirTemp("", "TestNewFileWriter.*")
if err != nil {
dir := filepath.Join(os.TempDir(), strconv.FormatInt(time.Now().UnixNano(), 10), "TestFileWriter")
if err := os.MkdirAll(dir, 0766); err != nil {
t.Fatal(err)
}
defer func() {
Expand Down

0 comments on commit 077edf6

Please sign in to comment.