老许的bug ?

Syutran · · 4253 次点击
同时买了谢佬的<Go Web 编程> 也不厚, 莫非GO的大V们都合着伙呢?
#8
更多评论
polaris
社区,需要你我一同完善!
给个上下文啊。imgid 是啥类型?
#1
连个图片也不支持啊,http://www.freeimagehosting.net/9ygno.png package main func listHandler(w http.ResponseWriter, r *http.Request) { fileInfoArr, err := ioutil.ReadDir("./uploads") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } var listHtml string for _, fileInfo := range fileInfoArr { imgid := fileInfo.Name listHtml += "<li><a href=\"/view?id=" + imgid + "\">imgid</a></li>" } io.WriteString(w, "<ol>"+listHtml+"</ol>") }
#4