老许的bug ?

Syutran · · 4220 次点击
polaris
社区,需要你我一同完善!
哈哈哈
#7
更多评论
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