| 
									
										
										
										
											2009-01-09 15:16:31 -08: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 17:54:07 -08:00
										 |  |  | type testType struct { a int; b string } | 
					
						
							| 
									
										
										
										
											2009-01-09 15:16:31 -08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-01-15 17:54:07 -08:00
										 |  |  | func (t *testType) String() string { | 
					
						
							| 
									
										
										
										
											2009-01-15 13:48:11 -08:00
										 |  |  | 	return fmt.Sprint(t.a) + " " + t.b | 
					
						
							| 
									
										
										
										
											2009-01-09 15:16:31 -08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | func main() { | 
					
						
							| 
									
										
										
										
											2009-03-03 08:39:12 -08:00
										 |  |  | 	t := &testType{77, "Sunset Strip"}; | 
					
						
							| 
									
										
										
										
											2009-01-15 13:48:11 -08:00
										 |  |  | 	fmt.Println(t) | 
					
						
							| 
									
										
										
										
											2009-01-09 15:16:31 -08:00
										 |  |  | } |