From 941751d269b4155ee1e282d21d3318cc1088d4ca Mon Sep 17 00:00:00 2001 From: ashtukaturov Date: Fri, 10 Sep 2021 16:48:57 +0300 Subject: [PATCH] update to correct 06_01b (was as 05_04e) --- practice/main.go | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/practice/main.go b/practice/main.go index b169ae4..5bbf087 100644 --- a/practice/main.go +++ b/practice/main.go @@ -5,32 +5,5 @@ import ( ) func main() { - poodle := Dog{"Poodle", 10, "Woof!"} - fmt.Println(poodle) - fmt.Printf("%+v\n", poodle) - fmt.Printf("Breed: %v\nWeight: %v\n", poodle.Breed, poodle.Weight) - - poodle.Speak() - poodle.Sound = "Arf!" - poodle.Speak() - poodle.SpeakThreeTimes() - poodle.SpeakThreeTimes() -} - -// Dog is a struct -type Dog struct { - Breed string - Weight int - Sound string -} - -// Speak is how the dog speaks -func (d Dog) Speak() { - fmt.Println(d.Sound) -} - -// SpeakThreeTimes is how the dog speaks loudly -func (d Dog) SpeakThreeTimes() { - d.Sound = fmt.Sprintf("%v %v %v", d.Sound, d.Sound, d.Sound) - fmt.Println(d.Sound) + fmt.Println("Files") }