From 118093416310dd0a34710ec6cd26bbf15f2beeff Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Fri, 8 Apr 2022 16:43:13 -0700 Subject: [PATCH] curl: override any "-w" options that might exist See the code comment for an explanation. --- curl/command.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/curl/command.go b/curl/command.go index aaa67a4..28adb5c 100644 --- a/curl/command.go +++ b/curl/command.go @@ -14,6 +14,11 @@ func Command(ctx context.Context, url string, options ...Option) *exec.Cmd { args = append(args, arg) } } + // Override any settings that users might have by default - for example, + // Kevin Burke has "-w \n" in his .curlrc file. Adding a new line to the end + // of the file is great for readability for most responses but breaks pprof + // and trace parsing. + args = append(args, "-w", "") return exec.CommandContext(ctx, "curl", args...) }