Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io/ioutil and io packages having the same functionality is misleading as io doesn't contain ioutil.ReadFile #59885

Closed
GeekGawd opened this issue Apr 28, 2023 · 1 comment

Comments

@GeekGawd
Copy link

What version of Go are you using (go version)?

$ go version
go version go 1.20.3 windows/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
set GOHOSTARCH=amd64
set GOHOSTOS=windows

What did you do?

What did you expect to see?

// Deprecated: As of Go 1.16, the same functionality is now provided

The lines states that ioutil is deprecated and io provides the same fucntionality. However, io doesn't provide ReadFile. So, I expected to see a implementation of the same in io but didn't find one.

@fzipp
Copy link
Contributor

fzipp commented Apr 28, 2023

It says:

the same functionality is now provided by package io or package os

Emphasis on "or package os". The new ReadFile function is in package os, as the documentation says:

Deprecated: As of Go 1.16, this function simply calls os.ReadFile

@golang golang locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants