From 415621c7ca2e513c60f40970ae2386424fd4950f Mon Sep 17 00:00:00 2001
From: Eli Bendersky
Date: Tue, 1 Jun 2021 06:17:16 -0700
Subject: [PATCH] Remove usage of ioutil from gobyexample's own scripts
+ regenerate output
---
examples/directories/directories.hash | 4 ++--
examples/reading-files/reading-files.hash | 4 ++--
.../spawning-processes.hash | 4 ++--
.../temporary-files-and-directories.hash | 4 ++--
examples/writing-files/writing-files.hash | 4 ++--
public/directories | 13 +++++------
public/reading-files | 7 +++---
public/spawning-processes | 8 +++----
public/temporary-files-and-directories | 21 ++++++++---------
public/writing-files | 7 +++---
tools/generate.go | 23 ++++++++++---------
tools/measure.go | 3 +--
12 files changed, 49 insertions(+), 53 deletions(-)
diff --git a/examples/directories/directories.hash b/examples/directories/directories.hash
index 7dae4aa..f62b81a 100644
--- a/examples/directories/directories.hash
+++ b/examples/directories/directories.hash
@@ -1,2 +1,2 @@
-fa3655fa8f4fa28e971cbe853dffb02773afce83
-UaeLMS5VQVR
+d2eaefdc6dbeaf130e4824403baa948b5845c0ec
+cICbVSX51zI
diff --git a/examples/reading-files/reading-files.hash b/examples/reading-files/reading-files.hash
index 2933d50..4250929 100644
--- a/examples/reading-files/reading-files.hash
+++ b/examples/reading-files/reading-files.hash
@@ -1,2 +1,2 @@
-3420958bafd67fd997481d1ada288566666343c7
-kF0cDC0drsX
+5351edae47bb2f2c9b5d4b9682b8176beb0c24e5
+DF2Wo8nDKaF
diff --git a/examples/spawning-processes/spawning-processes.hash b/examples/spawning-processes/spawning-processes.hash
index 3c800a5..c0f815f 100644
--- a/examples/spawning-processes/spawning-processes.hash
+++ b/examples/spawning-processes/spawning-processes.hash
@@ -1,2 +1,2 @@
-6a62e3109c483c2b52a99905dc1ba5c8cb2a281b
-m2CpSlHPEVq
+b6e1e4b70a494be9f344a9f31aff520116d0ac24
+YJs_YtJY0sS
diff --git a/examples/temporary-files-and-directories/temporary-files-and-directories.hash b/examples/temporary-files-and-directories/temporary-files-and-directories.hash
index cf6faa7..2bc959f 100644
--- a/examples/temporary-files-and-directories/temporary-files-and-directories.hash
+++ b/examples/temporary-files-and-directories/temporary-files-and-directories.hash
@@ -1,2 +1,2 @@
-cc4755e23cb4ba3c0e0ef5554ec9e9477372422a
-nMpjCsALS6P
+d875fd8f061e895d72c48c360a8ad4b04e406dd4
+hVcPg9RH3_V
diff --git a/examples/writing-files/writing-files.hash b/examples/writing-files/writing-files.hash
index 1513200..fcac248 100644
--- a/examples/writing-files/writing-files.hash
+++ b/examples/writing-files/writing-files.hash
@@ -1,2 +1,2 @@
-314a0074840e22b328b6412130c17b9bea53c9c9
-fQ7sd4gXv0F
+e312100df0c063ecd65e7599653636188277b6a6
+Y12O-L_zFS1
diff --git a/public/directories b/public/directories
index 41e52b4..9c2cba2 100644
--- a/public/directories
+++ b/public/directories
@@ -42,7 +42,7 @@
- 
+ 
package main
|
@@ -56,7 +56,6 @@
import (
"fmt"
- "io/ioutil"
"os"
"path/filepath"
)
@@ -131,7 +130,7 @@ will delete a whole directory tree (similarly to
createEmptyFile := func(name string) {
d := []byte("")
- check(ioutil.WriteFile(name, d, 0644))
+ check(os.WriteFile(name, d, 0644))
}
@@ -180,13 +179,13 @@ command-line mkdir -p
.
ReadDir lists directory contents, returning a
-slice of os.FileInfo objects.
+slice of os.DirEntry objects.
|
- c, err := ioutil.ReadDir("subdir/parent")
+ c, err := os.ReadDir("subdir/parent")
check(err)
|
@@ -230,7 +229,7 @@ when listing the current directory.
- c, err = ioutil.ReadDir(".")
+ c, err = os.ReadDir(".")
check(err)
|
@@ -343,7 +342,7 @@ recursively by filepath.Walk
.