我用高朗学习高朗,我的高朗有什么问题吗?需要更改配置信息吗? 我的代码
package main
import (
"golang.org/x/tour/pic"
"image"
"image/color"
)
type Image struct{} //新建一个Image struct 体
func (i Image) ColorModel() color.Model { //实现Image包中 colored颜色 模式的方法
return color.RGBAModel
}
func (i Image) Bounds() image.Rectangle { //实现Image包中生成图片边界的方法
return image.Rect(0, 0, 200, 200)
}
func (i Image) At(x, y int) color.Color { //实现Image包中生成图像某个点的方法
return color.RGBA{uint8(x), uint8(y), uint8(255), uint8(255)}
}
func main() {
m := Image{}
pic.ShowImage(m) //调用
}
i use https://tour.go-zh.org/methods/24 and run golang return a picture