Skip to content

Commit 2a00bb5

Browse files
committed
Reformat code comments
1 parent 448279a commit 2a00bb5

File tree

2 files changed

+20
-22
lines changed

2 files changed

+20
-22
lines changed

request.go

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,23 @@ func newErrUnsupportedPtrType(rf reflect.Value, t reflect.Type, structField refl
6969
// For example you could pass it, in, req.Body and, model, a BlogPost
7070
// struct instance to populate in an http handler,
7171
//
72-
// func CreateBlog(w http.ResponseWriter, r *http.Request) {
73-
// blog := new(Blog)
72+
// func CreateBlog(w http.ResponseWriter, r *http.Request) {
73+
// blog := new(Blog)
7474
//
75-
// if err := jsonapi.UnmarshalPayload(r.Body, blog); err != nil {
76-
// http.Error(w, err.Error(), 500)
77-
// return
78-
// }
75+
// if err := jsonapi.UnmarshalPayload(r.Body, blog); err != nil {
76+
// http.Error(w, err.Error(), 500)
77+
// return
78+
// }
7979
//
80-
// // ...do stuff with your blog...
80+
// // ...do stuff with your blog...
8181
//
82-
// w.Header().Set("Content-Type", jsonapi.MediaType)
83-
// w.WriteHeader(201)
84-
//
85-
// if err := jsonapi.MarshalPayload(w, blog); err != nil {
86-
// http.Error(w, err.Error(), 500)
87-
// }
88-
// }
82+
// w.Header().Set("Content-Type", jsonapi.MediaType)
83+
// w.WriteHeader(201)
8984
//
85+
// if err := jsonapi.MarshalPayload(w, blog); err != nil {
86+
// http.Error(w, err.Error(), 500)
87+
// }
88+
// }
9089
//
9190
// Visit https://github.com/google/jsonapi#create for more info.
9291
//

response.go

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,16 @@ var (
5151
// Many Example: you could pass it, w, your http.ResponseWriter, and, models, a
5252
// slice of Blog struct instance pointers to be written to the response body:
5353
//
54-
// func ListBlogs(w http.ResponseWriter, r *http.Request) {
55-
// blogs := []*Blog{}
54+
// func ListBlogs(w http.ResponseWriter, r *http.Request) {
55+
// blogs := []*Blog{}
5656
//
57-
// w.Header().Set("Content-Type", jsonapi.MediaType)
58-
// w.WriteHeader(http.StatusOK)
57+
// w.Header().Set("Content-Type", jsonapi.MediaType)
58+
// w.WriteHeader(http.StatusOK)
5959
//
60-
// if err := jsonapi.MarshalPayload(w, blogs); err != nil {
61-
// http.Error(w, err.Error(), http.StatusInternalServerError)
60+
// if err := jsonapi.MarshalPayload(w, blogs); err != nil {
61+
// http.Error(w, err.Error(), http.StatusInternalServerError)
62+
// }
6263
// }
63-
// }
64-
//
6564
func MarshalPayload(w io.Writer, models interface{}) error {
6665
payload, err := Marshal(models)
6766
if err != nil {

0 commit comments

Comments
 (0)