Created
September 11, 2017 02:43
-
-
Save kanapuli/5d27d4d9a20ce6fafc3c6b11ef616bcb to your computer and use it in GitHub Desktop.
Type Alias main.go after refactoring
This file contains 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
package circle | |
import "github.com/err/square" | |
//CircleShape is the typealias for square.Shape | |
type CircleShape = square.Shape |
This file contains 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
package main | |
import ( | |
"fmt" | |
"github.com/err/circle" | |
"github.com/err/utility" | |
) | |
func main() { | |
c := circle.CircleShape{ | |
Name: "circle", | |
Height: 10, | |
} | |
fmt.Printf("%v\n", c) | |
fmt.Println(utility.IsFiveFeet(c)) | |
} | |
//output: | |
// go run main.go | |
// Square has the height 10 | |
// false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment