1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
12 // MyError is an error implementation that includes a time and message.
18 func (e MyError) Error() string {
19 return fmt.Sprintf("%v: %v", e.When, e.What)
24 time.Date(1989, 3, 15, 22, 30, 0, 0, time.UTC),
25 "the file system has gone away",
30 if err := oops(); err != nil {
33 // Output: 1989-03-15 22:30:00 +0000 UTC: the file system has gone away