Skip to content

Instantly share code, notes, and snippets.

@itaditya
Last active December 3, 2021 22:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save itaditya/b7752792a84b85759352133100f537d2 to your computer and use it in GitHub Desktop.
Save itaditya/b7752792a84b85759352133100f537d2 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