```go
func getThumbMediaId(image_path string) (*mediaclient.MediaInfo, string) {
fmt.Println("getThumbMediaId is running...")
var media_client = mediaclient.NewClient(AccessTokenServer, nil)
mediainfo, error := media_client.UploadThumb("../my/haishi_news/06-news/images/" + image_path)
var err string
if error != nil {
fmt.Println("错误是:", error)
err = fmt.Sprint(error)
fmt.Println(err)
}
return mediainfo, err
}
```
上面这段代码,想把那个err输出给前台页面的,求指教。
![](http://studygolang.qiniudn.com/151107/06ebcedc33612d7686a5dbbb9ff8c35e.png)
cannot use err (type string) as type io.Writer in argument to fmt.Fprint
string does not implement io.Writer (missing Write method)
貌似不行啊,缺少个输出方式
#4
更多评论