Skip to content

Commit

Permalink
Apply extracted function
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Meyer committed Apr 17, 2015
1 parent c92e499 commit d935d18
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,8 @@ func encode_json(response []interface{}) string {
return string(encoded)
}

func pending_response() string {
encoded, _ := json.Marshal(wire_pending())
return string(encoded)
}

func fail_response(message string) string {
response := append(wire_fail(), map[string]string{"message": message})
return encode_json(response)
}

func success_response() string {
encoded, _ := json.Marshal(wire_success())
return string(encoded)
return encode_json(wire_success())
}

func success_response_steps(id string, arguments []capturing_group) string {
Expand Down Expand Up @@ -157,3 +146,12 @@ func success_response_snippet(name string, keyword string) string {

return encode_json(response)
}

func pending_response() string {
return encode_json(wire_pending())
}

func fail_response(message string) string {
response := append(wire_fail(), map[string]string{"message": message})
return encode_json(response)
}

0 comments on commit d935d18

Please sign in to comment.