Update 11.1.md

This commit is contained in:
无闻
2017-06-05 01:43:15 -04:00
committed by GitHub
parent b1e73c1342
commit 46db632865

View File

@@ -67,12 +67,12 @@ func main() {
sq1 := new(Square) sq1 := new(Square)
sq1.side = 5 sq1.side = 5
// var areaIntf Shaper var areaIntf Shaper
// areaIntf = sq1 areaIntf = sq1
// shorter,without separate declaration: // shorter,without separate declaration:
// areaIntf := Shaper(sq1) // areaIntf := Shaper(sq1)
// or even: // or even:
areaIntf := sq1 // areaIntf := sq1
fmt.Printf("The square has area: %f\n", areaIntf.Area()) fmt.Printf("The square has area: %f\n", areaIntf.Area())
} }
``` ```