Created
January 26, 2016 13:38
-
-
Save motokiee/bc4ee2d7f2f9735bc184 to your computer and use it in GitHub Desktop.
golang #CodePiece
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) greet() { | |
fmt.Printf("Hi, %s\n", p.name) | |
} | |
func main() { | |
person := Person {"Motoki", 30} | |
person.greet() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment