Skip to content

Commit

Permalink
fix: trim new line
Browse files Browse the repository at this point in the history
  • Loading branch information
narongdejsrn committed Jun 18, 2022
1 parent 8c8ff31 commit 01583c6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ func main() {
res, err := http.Get(*url)

if err == nil && res.StatusCode == *responseCode {
// check response body
if *expectedResponse != "" {
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
bodyStr := string(body)
bodyStr := strings.Trim(string(body), "\n")
if bodyStr == *expectedResponse {
fmt.Printf("Response body: %v", bodyStr)
os.Exit(0)
Expand Down
Binary file added wait_for_response
Binary file not shown.

0 comments on commit 01583c6

Please sign in to comment.