megaease / easeprobe

A simple, standalone, and lightweight tool that can do health/status checking, written in Go.
Apache License 2.0
2.18k stars 231 forks source link

fix json escape #563

Closed suchen-sci closed 2 months ago

suchen-sci commented 2 months ago
    body := fmt.Sprintf("*%s*\\n>%s %s - ⏱ %s\n>%s",
        r.Title(), r.Status.Emoji(), r.Endpoint, rtt, JSONEscape(r.Message))
    output := fmt.Sprintf(jsonMsg, summary, body, context)

The second \n in body will produce invalid json output, we should fix it like first \n, use \\n instead.

codecov-commenter commented 2 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.46%. Comparing base (eef3a25) to head (b317840). Report is 59 commits behind head on main.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #563 +/- ## ========================================== - Coverage 98.80% 98.46% -0.35% ========================================== Files 85 85 Lines 5867 5870 +3 ========================================== - Hits 5797 5780 -17 - Misses 51 66 +15 - Partials 19 24 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.