diff --git a/09-go-type-system/exercises/05-refactor-feet-to-meter/main.go b/09-go-type-system/exercises/05-refactor-feet-to-meter/main.go index b8a121b..1782d09 100644 --- a/09-go-type-system/exercises/05-refactor-feet-to-meter/main.go +++ b/09-go-type-system/exercises/05-refactor-feet-to-meter/main.go @@ -20,7 +20,7 @@ package main func main() { // ---------------------------- // 1. Define Feet and Meters types below - // Their underlying type can be int64 + // Their underlying type can be float64 // ... // ---------------------------- @@ -32,7 +32,7 @@ func main() { // ---------------------------- // 3. Get feet value from the command-line - // 4. Convert it to an int64 first using ParseFloat + // 4. Convert it to an float64 first using ParseFloat // 5. Then, convert it into a Feet type // ... TYPE YOUR CODE HERE diff --git a/09-go-type-system/exercises/05-refactor-feet-to-meter/solution/main.go b/09-go-type-system/exercises/05-refactor-feet-to-meter/solution/main.go index 1d90214..a04fb2b 100644 --- a/09-go-type-system/exercises/05-refactor-feet-to-meter/solution/main.go +++ b/09-go-type-system/exercises/05-refactor-feet-to-meter/solution/main.go @@ -13,11 +13,12 @@ import ( "strconv" ) -// WHY? -// Because, you can add methods to your types in the future -// And, they're type-safe and more readable now. - func main() { + // WHY ADDING YOUR OWN TYPES IS IMPORTANT? + // + // 1. Type-Safety + // 2. Increased Readability + // 3. Adding Methods to your Types type ( Feet float64 Meters float64