1
0
Fork 0
mirror of https://github.com/vbatts/talks.git synced 2024-11-16 05:28:37 +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