4
4
5
5
// Package ioutil implements some I/O utility functions.
6
6
//
7
- // As of Go 1.16, the same functionality is now provided
7
+ // Deprecated: As of Go 1.16, the same functionality is now provided
8
8
// by package io or package os, and those implementations
9
9
// should be preferred in new code.
10
10
// See the specific function documentation for details.
@@ -22,7 +22,7 @@ import (
22
22
// defined to read from src until EOF, it does not treat an EOF from Read
23
23
// as an error to be reported.
24
24
//
25
- // As of Go 1.16, this function simply calls io.ReadAll.
25
+ // Deprecated: As of Go 1.16, this function simply calls io.ReadAll.
26
26
func ReadAll (r io.Reader ) ([]byte , error ) {
27
27
return io .ReadAll (r )
28
28
}
@@ -32,7 +32,7 @@ func ReadAll(r io.Reader) ([]byte, error) {
32
32
// reads the whole file, it does not treat an EOF from Read as an error
33
33
// to be reported.
34
34
//
35
- // As of Go 1.16, this function simply calls os.ReadFile.
35
+ // Deprecated: As of Go 1.16, this function simply calls os.ReadFile.
36
36
func ReadFile (filename string ) ([]byte , error ) {
37
37
return os .ReadFile (filename )
38
38
}
@@ -41,7 +41,7 @@ func ReadFile(filename string) ([]byte, error) {
41
41
// If the file does not exist, WriteFile creates it with permissions perm
42
42
// (before umask); otherwise WriteFile truncates it before writing, without changing permissions.
43
43
//
44
- // As of Go 1.16, this function simply calls os.WriteFile.
44
+ // Deprecated: As of Go 1.16, this function simply calls os.WriteFile.
45
45
func WriteFile (filename string , data []byte , perm fs.FileMode ) error {
46
46
return os .WriteFile (filename , data , perm )
47
47
}
@@ -51,7 +51,7 @@ func WriteFile(filename string, data []byte, perm fs.FileMode) error {
51
51
// sorted by filename. If an error occurs reading the directory,
52
52
// ReadDir returns no directory entries along with the error.
53
53
//
54
- // As of Go 1.16, os.ReadDir is a more efficient and correct choice:
54
+ // Deprecated: As of Go 1.16, os.ReadDir is a more efficient and correct choice:
55
55
// it returns a list of fs.DirEntry instead of fs.FileInfo,
56
56
// and it returns partial results in the case of an error
57
57
// midway through reading a directory.
@@ -72,13 +72,13 @@ func ReadDir(dirname string) ([]fs.FileInfo, error) {
72
72
// NopCloser returns a ReadCloser with a no-op Close method wrapping
73
73
// the provided Reader r.
74
74
//
75
- // As of Go 1.16, this function simply calls io.NopCloser.
75
+ // Deprecated: As of Go 1.16, this function simply calls io.NopCloser.
76
76
func NopCloser (r io.Reader ) io.ReadCloser {
77
77
return io .NopCloser (r )
78
78
}
79
79
80
80
// Discard is an io.Writer on which all Write calls succeed
81
81
// without doing anything.
82
82
//
83
- // As of Go 1.16, this value is simply io.Discard.
83
+ // Deprecated: As of Go 1.16, this value is simply io.Discard.
84
84
var Discard io.Writer = io .Discard
0 commit comments