Skip to content

Commit

Permalink
io/ioutil: Deprecate TempFile and TempDir
Browse files Browse the repository at this point in the history
These were deprecated in `go` `1.17`, so marked them as officially
`Deprecated: `.

Fix #51927
  • Loading branch information
jeffwidman committed Mar 26, 2022
1 parent aae1fbd commit 3c3603f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/io/ioutil/tempfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
// to find the pathname of the file. It is the caller's responsibility
// to remove the file when no longer needed.
//
// As of Go 1.17, this function simply calls os.CreateTemp.
// Deprecated: As of Go 1.17, this function simply calls os.CreateTemp.
func TempFile(dir, pattern string) (f *os.File, err error) {
return os.CreateTemp(dir, pattern)
}
Expand All @@ -35,7 +35,7 @@ func TempFile(dir, pattern string) (f *os.File, err error) {
// will not choose the same directory. It is the caller's responsibility
// to remove the directory when no longer needed.
//
// As of Go 1.17, this function simply calls os.MkdirTemp.
// Deprecated: As of Go 1.17, this function simply calls os.MkdirTemp.
func TempDir(dir, pattern string) (name string, err error) {
return os.MkdirTemp(dir, pattern)
}

0 comments on commit 3c3603f

Please sign in to comment.