1
0
Fork 0
mirror of https://github.com/vbatts/talks.git synced 2024-12-27 09:06:30 +00:00
talks/2015/06-devnation-golang-good-bad-ugly/ugly2.go

27 lines
327 B
Go

// +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