From bc2210247861340c644d9825ac2b2860f8c6e12a Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Mon, 10 May 2021 12:01:27 -0600 Subject: caddyfile: Fix `caddy fmt` nesting not decrementing (#4157) * caddyfile(formatter): fix nesting not decrementing This is an extremely weird edge-case where if you had a environment variable {} on one line, a comment on the next line, and the closing of the block on the following line; the rest of the Caddyfile would be indented further than it should've been. ref; https://github.com/matthewpi/vscode-caddyfile-support/issues/13 * run gofmt * fmt: better way of handling edge case --- modules/caddyhttp/replacer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/caddyhttp/replacer_test.go') diff --git a/modules/caddyhttp/replacer_test.go b/modules/caddyhttp/replacer_test.go index 486a8e3..5026ac8 100644 --- a/modules/caddyhttp/replacer_test.go +++ b/modules/caddyhttp/replacer_test.go @@ -173,7 +173,7 @@ eqp31wM9il1n+guTNyxJd+FzVAH+hCZE5K+tCgVDdVFUlDEHHbS/wqb2PSIoouLV }, { input: "{http.request.tls.client.certificate_pem}", - expect: string(clientCert) + "\n", // returned value comes with a newline appended to it + expect: string(clientCert) + "\n", // returned value comes with a newline appended to it }, } { actual := repl.ReplaceAll(tc.input, "") -- cgit v1.2.3