Skip to content

Instantly share code, notes, and snippets.

@viveksyngh
Created September 4, 2018 11:03
Show Gist options
  • Select an option

  • Save viveksyngh/b64359dc2b5ed5d2cd15f7df3e88c9d2 to your computer and use it in GitHub Desktop.

Select an option

Save viveksyngh/b64359dc2b5ed5d2cd15f7df3e88c9d2 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
//Person struct to store person information
type Person struct {
FirstName string
LastName string
}
func (p Person) getFullName() string {
return p.FirstName + " " + p.LastName
}
func main() {
p := Person{FirstName: "John", LastName: "Doe"}
fmt.Printf("%s\n", p.getFullName())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment