github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/talks/2015/tricks/embed.go (about)

     1  // +build ignore
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  // BEGIN OMIT
     8  type A struct {
     9  	s string
    10  }
    11  
    12  func (a A) String() string {
    13  	return fmt.Sprintf("A's String method called: %v", a.s)
    14  }
    15  
    16  type B struct {
    17  	A
    18  }
    19  
    20  func main() {
    21  	b := B{}
    22  	b.s = "some value"
    23  	fmt.Println(b)
    24  }