You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running swag fmt, the formatter updates the permission of the files.
This minor difference usually don't cause any issues, only in some cases like if someone is running swag fmt with root permission. The owner is changed the root. With group read permission gone, the user cannot access the formatted file.
Overall, I believe fmt should preserve the permission from the original file as a default behavior.
To Reproduce
Check the file permission before formatting
> ls -l
-rw-r--r-- 1 user user 7755 Aug 2 9:42 main.go
run swag fmt
Check the file permission again
> ls -l
-rw------- 1 user user 7755 Aug 2 9:43 main.go
// If running with root, because user is change, user don't have permission to read the file anymore
Expected behavior fmt should preserve the permission from the original file.
Your swag version
v1.8.12
Your go version
e.g. 1.12.0
Desktop (please complete the following information):
OS: macOS
Version: Ventura 13.0
The text was updated successfully, but these errors were encountered:
Describe the bug
When running
swag fmt
, the formatter updates the permission of the files.This minor difference usually don't cause any issues, only in some cases like if someone is running
swag fmt
with root permission. The owner is changed the root. With group read permission gone, the user cannot access the formatted file.Overall, I believe
fmt
should preserve the permission from the original file as a default behavior.To Reproduce
> ls -l -rw-r--r-- 1 user user 7755 Aug 2 9:42 main.go
swag fmt
Expected behavior
fmt
should preserve the permission from the original file.Your swag version
v1.8.12
Your go version
e.g. 1.12.0
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: