bytes, err := ioutil.ReadAll("path.txt")
is the golang equivalent.
is the golang equivalent.
let bytes = std::fs::read(“path.txt”)?;
If you’re trying to actually do this in real code. The example is how you’d write this function yourself, but if you’re just trying to Get It Done, it’s significantly easier than the example.