4 ms·
bytes, err := ioutil.ReadAll("path.txt") is the golang equivalent.
by jatone 5y ago
bytes, err := ioutil.ReadAll("path.txt")
is the golang equivalent.
- deleted 5y ago[deleted]
- steveklabnik 5y agoTo be clear you can write 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.