Reputation: 45295
I am going to use ReadFile:
package main
import (
"fmt"
"io/ioutil"
)
func main() {
ReadFile("data.txt")
}
>> undefined: ReadFile
How can I fix it?
Upvotes: 2
Views: 15377
Reputation: 7877
Qualify it with the package name:
package main
import (
"io/ioutil"
)
func main() {
ioutil.ReadFile("data.txt")
}
Upvotes: 12