August 2019
Beginner to intermediate
798 pages
17h 2m
English
If you really want to grasp the usefulness of the syscall package, start by reading this subsection. The implementation of the fmt.Println() function, as found in https://golang.org/src/fmt/print.go, is as follows:
func Println(a ...interface{}) (n int, err error) {
return Fprintln(os.Stdout, a...)
}
This means that the fmt.Println() function calls fmt.Fprintln() to do its job. The implementation of fmt.Fprintln(), as found in the same file, is as follows:
func Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
p := newPrinter()
p.doPrintln(a)
n, err = w.Write(p.buf)
p.free()
return
}
This means that the actual writing in fmt.Fprintln() is done by the Write() function of the io.Writer ...
Read now
Unlock full access