Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backticks are removed from file dump #1

Open
chriscow opened this issue Jan 22, 2025 · 1 comment · May be fixed by #2
Open

Backticks are removed from file dump #1

chriscow opened this issue Jan 22, 2025 · 1 comment · May be fixed by #2
Assignees
Labels
bug Something isn't working

Comments

@chriscow
Copy link

It seems any source file that has a backtick string will get its backticks removed.

For example:

		var event struct {
			Type string `json:"type"`
		}

results in:

	var event struct {
		Type string json:"type"
	}

in the file. (see the json struct tags)

@Broderick-Westrope Broderick-Westrope linked a pull request Jan 27, 2025 that will close this issue
@Broderick-Westrope Broderick-Westrope changed the title Backticks are removed from source files Backticks are removed from file dump Jan 27, 2025
@Broderick-Westrope
Copy link
Owner

Broderick-Westrope commented Jan 27, 2025

Hi @chriscow, thanks for trying the tool and giving this feedback. I've created a PR (#2) for the solution to this issue, but I'm having trouble reproducing it.

In the PR I've updated an existing test case to include struct tags with backticks and it succeeds as desired. I've also tested it out locally (MacOS 15.1 with M1 chip) and couldn't reproduce. Could you provide the following details to help me debug this:

  • Amalgo version (amalgo -v). If you don't have the latest (0.5.1) please update and retry.
  • Create a single file that includes an example that produces this error. If you provide me with this file I will try it on my end. Please do not include any sensitive information in this file.

A good example of a working file is this projects main.go file. If I run amalgo -f 'main.go' I get the correct output including all the backticks that are used for the RootCmd struct.

@Broderick-Westrope Broderick-Westrope self-assigned this Jan 27, 2025
@Broderick-Westrope Broderick-Westrope added the bug Something isn't working label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants