github.com/EngineerKamesh/gofullstack@v0.0.0-20180609171605-d41341d7d4ee/volume1/section3/shapedemo/shapedemo.go (about) 1 // A demonstration program using the simpleshape package. 2 package main 3 4 import ( 5 "fmt" 6 7 "github.com/EngineerKamesh/gofullstack/volume1/section3/simpleshape" 8 ) 9 10 func main() { 11 12 r := simpleshape.NewRectangle(9, 6) 13 t := simpleshape.NewTriangle(3, 6) 14 15 fmt.Println("Area of myRectangle: ", simpleshape.ShapeArea(r)) 16 fmt.Println("Area of myTriangle: ", simpleshape.ShapeArea(t)) 17 18 }