I come to a very bothering problem, And it took me about an hour to figure what cause the problem, but I don't know why:
I am using html/template
to rending a web page and the code is like this:
t, _ := template.parseFiles("template/index.tmpl")
...
t.Execute(w, modelView) // w is a http.ResponseWriter and modelView is a data struct.
But unconsciously, I made a mistake that leave a <textarea>
tag open:
<html>
<body>
<form id="batchAddUser" class="form-inline">
**this one** --> <textarea name="users" value="" row=3 placeholder="input username and password splited by space">
<button type="submit" class="btn btn-success" >Add</button>
</form>
</body>
</html>
And then Go gives no exception and other hint, but just give a blank page with nothing, and the status code is 200
.
It toke effect to locate the problem since no information was offered, but why is that happen? How comes a un-colsed tag cause problem like that? And how to debug that?