github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2014/taste/point.go (about)

     1  // +build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  // Point START OMIT
     8  type Point struct {
     9  	x, y int
    10  }
    11  
    12  // Point END OMIT
    13  
    14  // String START OMIT
    15  func (p Point) String() string {
    16  	return fmt.Sprintf("(%d, %d)", p.x, p.y)
    17  }
    18  
    19  // String END OMIT
    20  
    21  // main START OMIT
    22  func main() {
    23  	p := Point{2, 3}
    24  	fmt.Println(p.String())
    25  	fmt.Println(Point{3, 5}.String())
    26  }
    27  
    28  // main END OMIT