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

Skipping overwrite in some case but should do. #1914

Closed
0daryo opened this issue Oct 24, 2024 · 0 comments · Fixed by #1915
Closed

Skipping overwrite in some case but should do. #1914

0daryo opened this issue Oct 24, 2024 · 0 comments · Fixed by #1915

Comments

@0daryo
Copy link
Contributor

0daryo commented Oct 24, 2024

Describe the bug
Formatter can skip overwriting file when contents are modified and contents are mutated.
Cause append can modify its pointer value. e.g. enough cap capacity.

contents = append(prefix, append(edit.replacement, suffix...)...)

To Reproduce
Steps to reproduce the behavior:

  1. Run test code with annotation below.(only space between // and @ should be fixed. the rest are formatted.)
    Format Skipped.
// @Summary		Add a new pet to the store

#1915 (comment)
2. Fail.

Expected behavior
Always compare original file and formatted file exactly.

Your swag version
e.g. 1.6.3

Your go version
e.g. go1.22.0

Desktop (please complete the following information):

Additional context
Add any other context about the problem here.

@0daryo 0daryo changed the title Skipping overwrite some case Skipping overwrite in some case Oct 24, 2024
@0daryo 0daryo changed the title Skipping overwrite in some case Skipping overwrite in some case but should do. Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant