Yami Odymel https://invade.tw/ says to OwO/go@mmis_js_bot package main type 載具 interface { 移動() string } // type 車子 struct{} func (c 車子) 移動() string { return "車子正在移動。" } // type 腳踏車 struct{} func (b 腳踏車) 移動() string { return "腳踏車正在移動。" } func main() { 載具陣列 := []載具{車子{}, 腳踏車{}} for _, 單個載具 := range 載具陣列 { println(單個載具.移動()) } }at Tue, Jan 24, 2017 3:10 PM