Skip to content

Commit

Permalink
Fix staticcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
ikawaha committed Aug 9, 2020
1 parent ee60c6e commit d5e36ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/kagome/server/api.go
Expand Up @@ -36,13 +36,13 @@ func (h *TokenizeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if err := json.NewDecoder(r.Body).Decode(&body); err != nil {
w.WriteHeader(http.StatusBadRequest)
msg := fmt.Sprintf("{\"status\":false,\"error\":\"%v\"}\n", err)
if _, err := fmt.Fprintf(w, msg); err != nil {
if _, err := fmt.Fprint(w, msg); err != nil {
log.Printf("write error, %s, %v", msg, err)
}
return
}
if body.Input == "" {
msg := fmt.Sprintf("{\"status\":true,\"tokens\":[]}\n")
msg := "{\"status\":true,\"tokens\":[]}\n"
if _, err := fmt.Fprint(w, msg); err != nil {
log.Fatalf("write error, %s, %v", msg, err)
}
Expand Down Expand Up @@ -85,7 +85,7 @@ func (h *TokenizeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
msg := fmt.Sprintf("{\"status\":false,\"error\":\"%v\"}", err)
if _, err := fmt.Fprintf(w, msg); err != nil {
if _, err := fmt.Fprint(w, msg); err != nil {
log.Printf("write error, %s, %v", msg, err)
}
return
Expand Down

0 comments on commit d5e36ce

Please sign in to comment.