diff options
| author | Philipp Tanlak <philipp.tanlak@gmail.com> | 2023-12-04 17:35:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-04 17:35:06 +0100 |
| commit | 8c68e0ed414bfb323d6e94db55c95db13797ef8e (patch) | |
| tree | 379fd505aec7e54d9f7dcc7b7d6ae5264f4b956a /utils.go | |
| parent | 807b9a1693645270609d4d795aa2b8eeacaae40e (diff) | |
Make output file and format configurable (#24)
Diffstat (limited to 'utils.go')
| -rw-r--r-- | utils.go | 11 |
1 files changed, 0 insertions, 11 deletions
@@ -5,8 +5,6 @@ package flyscrape import ( - "bytes" - "encoding/json" "fmt" "io" "net/http" @@ -15,15 +13,6 @@ import ( const HeaderBypassCache = "X-Flyscrape-Bypass-Cache" -func Prettify(v any, prefix string) string { - var buf bytes.Buffer - enc := json.NewEncoder(&buf) - enc.SetEscapeHTML(false) - enc.SetIndent(prefix, " ") - enc.Encode(v) - return prefix + strings.TrimSuffix(buf.String(), "\n") -} - type RoundTripFunc func(*http.Request) (*http.Response, error) func (f RoundTripFunc) RoundTrip(r *http.Request) (*http.Response, error) { |