Categorygithub.com/kdlug/gocourse010-basics-cards-project
directory
0.0.0-20240710092454-d40bdaea4b58
Repository: https://github.com/kdlug/go.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
use type deck and create a method to print cards go run main.go deck.go.
create a newDeck function.
Range of slice sliceVar[startIndexIncluding:upToNotIncluding] fruits := []{"apple", "banana", "kiwi"} fruits[0:2] // apple, banana is equivalent to fruits[:2] add deck function which returns 2 values of type deck.
func writeFile(filename string, data []byte, perm os.FileMode) error our challenge is to extract data - convert deck to []byte type conversion []byte("Hi there") - converts a string to slice of bytes deck -> []byte deck -> []string -> join to a single string -> []byte func readFile(filename string) ([]byte, error).
shuffle cards using random number generator.
create deck_test.go (with _test.go suffix) file run: go test.