Skip to content

Instantly share code, notes, and snippets.

@kanapuli
Created September 11, 2017 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kanapuli/5d27d4d9a20ce6fafc3c6b11ef616bcb to your computer and use it in GitHub Desktop.
Save kanapuli/5d27d4d9a20ce6fafc3c6b11ef616bcb to your computer and use it in GitHub Desktop.
Type Alias main.go after refactoring
package circle
import "github.com/err/square"
//CircleShape is the typealias for square.Shape
type CircleShape = square.Shape
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