Skip to content

Commit 3c3603f

Browse files
committed
io/ioutil: Deprecate TempFile and TempDir
These were deprecated in `go` `1.17`, so marked them as officially `Deprecated: `. Fix #51927
1 parent aae1fbd commit 3c3603f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/io/ioutil/tempfile.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
// to find the pathname of the file. It is the caller's responsibility
2121
// to remove the file when no longer needed.
2222
//
23-
// As of Go 1.17, this function simply calls os.CreateTemp.
23+
// Deprecated: As of Go 1.17, this function simply calls os.CreateTemp.
2424
func TempFile(dir, pattern string) (f *os.File, err error) {
2525
return os.CreateTemp(dir, pattern)
2626
}
@@ -35,7 +35,7 @@ func TempFile(dir, pattern string) (f *os.File, err error) {
3535
// will not choose the same directory. It is the caller's responsibility
3636
// to remove the directory when no longer needed.
3737
//
38-
// As of Go 1.17, this function simply calls os.MkdirTemp.
38+
// Deprecated: As of Go 1.17, this function simply calls os.MkdirTemp.
3939
func TempDir(dir, pattern string) (name string, err error) {
4040
return os.MkdirTemp(dir, pattern)
4141
}

0 commit comments

Comments
 (0)