Skip to content

Commit

Permalink
qr: gofmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Nov 16, 2013
1 parent 8f8738b commit f136c2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 2 additions & 3 deletions qr/web/pic.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ func Encode(w http.ResponseWriter, req *http.Request) {
v := coding.Version(val("v"))
enc := coding.String(req.FormValue("t"))
m := coding.Mask(val("m"))

p, err := coding.NewPlan(v, l, m)
if err != nil {
panic(err)
Expand All @@ -497,10 +497,9 @@ func Encode(w http.ResponseWriter, req *http.Request) {
if err != nil {
panic(err)
}

c := &qr.Code{Bitmap: cc.Bitmap, Size: cc.Size, Stride: cc.Stride, Scale: 8}
w.Header().Set("Content-Type", "image/png")
w.Header().Set("Cache-Control", "public, max-age=3600")
w.Write(c.PNG())
}

8 changes: 4 additions & 4 deletions qr/web/play.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func Draw(w http.ResponseWriter, req *http.Request) {
if err := ctxt.Write("qrsave/"+tag, data); err != nil {
panic(err)
}
http.Redirect(w, req, "/qr/show/" + tag, http.StatusTemporaryRedirect)
http.Redirect(w, req, "/qr/show/"+tag, http.StatusTemporaryRedirect)
return
}

Expand Down Expand Up @@ -365,8 +365,8 @@ func flag(w http.ResponseWriter, req *http.Request, img string, ctxt *fs.Context
}
data, _, _ := ctxt.Read("qr/flag/" + img)
data = append(data, '!')
ctxt.Write("qr/flag/" + img, data)
ctxt.Write("qr/flag/"+img, data)

fmt.Fprintf(w, "Thank you. The image has been reported.\n")
}

Expand Down Expand Up @@ -424,7 +424,7 @@ type Image struct {
Dx int
Dy int
URL string
Tag string
Tag string
Version int
Mask int
Scale int
Expand Down

0 comments on commit f136c2f

Please sign in to comment.