1
0
Fork 0
mirror of https://github.com/vbatts/talks.git synced 2025-05-24 13:52:30 +00:00

2015-devnation: final changes

This commit is contained in:
Vincent Batts 2015-06-24 18:06:11 -04:00
parent 1b8e5c7a36
commit 8e251effd9
5 changed files with 152 additions and 8 deletions

View file

@ -0,0 +1,27 @@
// +build OMIT
package main
import (
"io"
"os"
)
// START1 OMIT
type Message string
func (m Message) WriteTo(w io.Writer) (int, error) {
return w.Write([]byte(m))
}
func (m Message) Reset() {
m = ""
}
func main() {
m := Message("Hello World\n")
m.WriteTo(os.Stdout)
m.Reset()
m.WriteTo(os.Stdout)
}
// STOP1 OMIT