package main
import (
"fmt"
)
type A struct {
Name string
}
type B struct {
Name string
}
type C int
type D struct {
name string
}
func main() {
a := A{}
a.Show()
b := B{}
b.Show()
var c C
c.Show()
(*C).Show(&c)
d := D{}
d.Show()
fmt.Println(d.name)
}
func (a A) Show() {
fmt.Println("A")
}
func (b B) Show() {
fmt.Println("B")
}
func (c *C) Show() {
fmt.Println("C")
}
func (d *D) Show() {
d.name = "ddd"
fmt.Println(d.name)
}