2009-01-09 16:16:31 -07:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
2009-01-15 18:54:07 -07:00
|
|
|
type testType struct { a int; b string }
|
2009-01-09 16:16:31 -07:00
|
|
|
|
2009-01-15 18:54:07 -07:00
|
|
|
func (t *testType) String() string {
|
2009-01-15 14:48:11 -07:00
|
|
|
return fmt.Sprint(t.a) + " " + t.b
|
2009-01-09 16:16:31 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2009-01-15 18:54:07 -07:00
|
|
|
t := &testType{77, "Sunset Strip"};
|
2009-01-15 14:48:11 -07:00
|
|
|
fmt.Println(t)
|
2009-01-09 16:16:31 -07:00
|
|
|
}
|