Skip to content

Instantly share code, notes, and snippets.

@lamarmarshall
Created October 20, 2017 01:38
Show Gist options
  • Save lamarmarshall/da78ce33c30db2a0dd13a35ef439a0e6 to your computer and use it in GitHub Desktop.
Save lamarmarshall/da78ce33c30db2a0dd13a35ef439a0e6 to your computer and use it in GitHub Desktop.
go oop, class, string conversion, int conversion
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