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

     1  // +build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  type Person struct{ Name string }
     8  
     9  func (p Person) Introduce() { fmt.Println("Hi, I'm", p.Name) }
    10  
    11  type Employee struct {
    12  	Person
    13  	EmployeeID int
    14  }
    15  
    16  func ExampleEmployee() {
    17  	var e Employee
    18  	e.Name = "Peter"
    19  	e.EmployeeID = 1234
    20  
    21  	e.Introduce()
    22  }