<!-- If you are reporting a new issue, make sure that we do not have any duplicates already open. You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead. If you suspect your issue is a bug, please edit your issue description to include the BUG REPORT INFORMATION shown below. If you fail to provide this information within 7 days, we cannot debug your issue and will close it. We will, however, reopen it if you later provide the information. For more information about reporting issues, see https://github.com/docker/compose-cli/blob/master/CONTRIBUTING.md#reporting-other-issues --------------------------------------------------- GENERAL SUPPORT INFORMATION --------------------------------------------------- The GitHub issue tracker is for bug reports and feature requests. General support can be found at the following locations: - Docker Support Forums - https://forums.docker.com - Docker Community Slack - https://dockr.ly/slack - Post a question on StackOverflow, using the Docker tag --------------------------------------------------- BUG REPORT INFORMATION --------------------------------------------------- Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST --> **Description** <!-- Briefly describe the problem you are having in a few paragraphs. --> **Steps to reproduce the issue:** ```sh ./bin/docker-compose version -f json ``` **Describe the results you received:** `{"version":"v2.3.0-2-gfcff3963"}\n` The newline character was not escaped properly **Describe the results you expected:** `{"version":"v2.3.0-2-gfcff3963"}` With a newline. **Additional information you deem important (e.g. issue happens only occasionally):** The json format is printed with: ```go fmt.Printf(`{"version":%q}\n`, internal.Version) ``` I think we should either use double-quotes and escape the inner quotes, instead of backticks because the newline is not escaped properly. ```go fmt.Printf("{\"version\":%q}\n", internal.Version) ``` Or add a newline character after the closing curly bracket like: ```go fmt.Printf(`{"version":%q} `, internal.Version) ``` I think the better option would be the first.
Activity