Closed 0daryo closed 4 weeks ago
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. https://github.com/swaggo/swag/blob/10f006f392f241444a0903b455111136f0385fbf/formatter.go#L93 To Reproduce Steps to reproduce the behavior:
// @Summary Add a new pet to the store
https://github.com/swaggo/swag/pull/1915#discussion_r1814888258
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.
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. https://github.com/swaggo/swag/blob/10f006f392f241444a0903b455111136f0385fbf/formatter.go#L93 To Reproduce Steps to reproduce the behavior:
https://github.com/swaggo/swag/pull/1915#discussion_r1814888258
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.