5
5
// Package ioutil implements some I/O utility functions.
6
6
//
7
7
// Deprecated: As of Go 1.16, the same functionality is now provided
8
- // by package io or package os , and those implementations
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.
11
11
package ioutil
@@ -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
- // Deprecated: 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
- // Deprecated: 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
- // Deprecated: 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,12 +51,12 @@ 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
- // Deprecated: As of Go 1.16, os.ReadDir is a more efficient and correct choice:
55
- // it returns a list of fs.DirEntry instead of fs.FileInfo,
54
+ // Deprecated: As of Go 1.16, [ os.ReadDir] is a more efficient and correct choice:
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.
58
58
//
59
- // If you must continue obtaining a list of fs.FileInfo, you still can:
59
+ // If you must continue obtaining a list of [ fs.FileInfo] , you still can:
60
60
//
61
61
// entries, err := os.ReadDir(dirname)
62
62
// if err != nil { ... }
@@ -83,13 +83,13 @@ func ReadDir(dirname string) ([]fs.FileInfo, error) {
83
83
// NopCloser returns a ReadCloser with a no-op Close method wrapping
84
84
// the provided Reader r.
85
85
//
86
- // Deprecated: As of Go 1.16, this function simply calls io.NopCloser.
86
+ // Deprecated: As of Go 1.16, this function simply calls [ io.NopCloser] .
87
87
func NopCloser (r io.Reader ) io.ReadCloser {
88
88
return io .NopCloser (r )
89
89
}
90
90
91
91
// Discard is an io.Writer on which all Write calls succeed
92
92
// without doing anything.
93
93
//
94
- // Deprecated: As of Go 1.16, this value is simply io.Discard.
94
+ // Deprecated: As of Go 1.16, this value is simply [ io.Discard] .
95
95
var Discard io.Writer = io .Discard
0 commit comments