Created
May 23, 2019 19:15
-
-
Save marvinhosea/635949a511b606daf2dad50f3d91a1c7 to your computer and use it in GitHub Desktop.
Sample Code Go ~ Rick n Motty
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 ricknmotty string | |
func (r ricknmotty) getWords() (string string){ | |
if r == "Rick"{ | |
return "We got a big announcement to make, Motty do you wanna make the announcement?" | |
} | |
return "no, no, no i don't wanna make the announcement" | |
} | |
func main(){ | |
var r ricknmotty = "Rick" | |
fmt.Printf(r.getWords()) | |
} | |
func (r ricknmotty) printWords() { | |
fmt.Println(r) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment