Skip to content

Instantly share code, notes, and snippets.

@silgon
Created June 29, 2021 21:03
Show Gist options
  • Save silgon/fa153a0b571895c89b3c67373d39bd43 to your computer and use it in GitHub Desktop.
Save silgon/fa153a0b571895c89b3c67373d39bd43 to your computer and use it in GitHub Desktop.
package main
import "fmt"
type person struct {
name string
age int
}
func (p person) print() {
fmt.Printf("%s is of %d years \n", p.name, p.age)
}
func main() {
alex := person{
name: "Alex",
age: 18,
}
alex.print()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment