标签:
有时候需要往浏览器访问的页面中输出调试信息,可以使用以下方法
import ( "fmt" "html/template" "io" "log" "net/http" ) func writeHandler(w http.ResponseWriter, r *http.Request) { w.Write([]byte("hello")) io.WriteString(w, "hello io.writestring") fmt.Fprintf(w, "abc") return }
标签:
原文地址:http://www.cnblogs.com/benlightning/p/4313105.html