Closed mesas998 closed 2 months ago
Context: https://go.dev/tour/methods/19 I dispensed with the function wrapper in the interest of clarity: michael.sweeney303@gmail.com
package main
import ( "fmt" "time" )
type MyError struct { When time.Time What string } func run() MyError { return MyError{time.Now(),"it didn't work",} }
func main() { returned := run() fmt.Printf("run() returned a %T consisting of a %T and a %T",returned,returned.When,returned.What) }
Context: https://go.dev/tour/methods/19 I dispensed with the function wrapper in the interest of clarity: michael.sweeney303@gmail.com
package main
import ( "fmt" "time" )
type MyError struct { When time.Time What string } func run() MyError { return MyError{time.Now(),"it didn't work",} }
func main() { returned := run() fmt.Printf("run() returned a %T consisting of a %T and a %T",returned,returned.When,returned.What) }