Created
October 20, 2017 01:38
-
-
Save lamarmarshall/da78ce33c30db2a0dd13a35ef439a0e6 to your computer and use it in GitHub Desktop.
go oop, class, string conversion, int conversion
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" | |
"strconv" | |
) | |
type Person struct { | |
name string | |
age int | |
} | |
func (p *Person) PrintName(){ | |
fmt.Println(p.name+" "+strconv.Itoa(p.age)) | |
} | |
func main(){ | |
var me = new(Person) | |
me.name = "lamar" | |
me.age = 35 | |
me.PrintName() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment