June 2017
Intermediate to advanced
400 pages
10h 32m
English
These steps cover writing and running your application:
Copy tests from https://github.com/agtorre/go-cookbook/tree/master/chapter1/interfaces, or use this as an exercise to write some of your own code.
package interfaces import ( "fmt" "io" "os" ) // Copy copies data from in to out first directly, // then using a buffer. It also writes to stdout func Copy(in io.ReadSeeker, out io.Writer) error { // we write to out, but also Stdout w := io.MultiWriter(out, os.Stdout) // a standard copy, this can be dangerous if there's a // lot of data ...Read now
Unlock full access