Created
July 5, 2021 21:05
-
-
Save todd-dsm/7d980a4f4b11971020c4e8204cda4c9a to your computer and use it in GitHub Desktop.
stylistically which is most correct, cards or the letter d?
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
// create a 'reciever' function | |
// this construct establishes methods on the variables we create | |
//----------------------------------------------------------------------------- | |
// 'cards' is a reference to the main.go/main variable: (presently instantiated) cards | |
func (cards deck) print() { | |
for index, card := range cards { | |
fmt.Println(index, card) | |
} | |
} | |
//-------------- same thing with a d | |
func (d deck) print() { | |
for index, card := range d { | |
fmt.Println(index, card) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment