Skip to content

Commit

Permalink
fix: refactor feet to meter exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Nov 10, 2018
1 parent 65fd15a commit 5916097
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions 09-go-type-system/exercises/05-refactor-feet-to-meter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ...

// ----------------------------
Expand All @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5916097

Please sign in to comment.