4 ms·
I see that as a strength of Go, that it lets you cherry-pick the packages you want to import and make available, so you only get what you want/need. This is goo
by shurcooL 13y ago
I see that as a strength of Go, that it lets you cherry-pick the packages you want to import and make available, so you only get what you want/need. This is good for many reasons.
99% of my projects don't use "fmt" nor "strings", but they may use packages that use "fmt" internally.
Reading the contents of a file into a string is this easy for me:
package main
import . "gist.github.com/5571468.git" // [1]
func main() {
s := MustReadFile("foo.txt")
print(s)
}
Finally, canonical Go code typically has function names like ReadLine [2] rather than rdLn. Where are you getting that from?
[1] https://gist.github.com/shurcooL/5571468 https://gist.github.com/shurcooL/5571468
[2] http://golang.org/pkg/bufio/#Reader.ReadLine http://golang.org/pkg/bufio/#Reader.ReadLine