Last active
December 3, 2021 22:21
-
-
Save itaditya/b7752792a84b85759352133100f537d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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