Lowercase JSON attributes

JSON tend to use lower casing when naming their fields. In Go however casing matters, as uppercase names means public access. To fix this we use field tags as shown below.
w.Header().Set("Content-Type", "application/json") model := struct { - Message string + Message string `json:"message"` }{ "No books available!", }
prev toc next