-
Notifications
You must be signed in to change notification settings - Fork 16
Refactor role selection and error handling in user and TOTP setup #1038
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
Open
zhangshanwen
wants to merge
8
commits into
main
Choose a base branch
from
fix-deepsource
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+184
−207
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Removed unused selectedItems variable from user role component functions in user_config.go and user.go. Improved error handling in TOTP setup page by checking for errors from otp.NewKeyFromURL and returning appropriate error messages. Simplified buffer handling and error return in OSS file retrieval handler.
Here's the code health analysis summary for commits Analysis Summary
|
Replaces all instances of 'len(str) > 0' with 'str != ""' for string emptiness checks in editing.go and simplifies variable initialization in list_publish_builder.go. This improves code readability and consistency.
Replaces nil with http.NoBody in HTTP request creation across tests for clarity and future compatibility. Refactors some variable initializations, improves error wrapping with fmt.Errorf, simplifies string concatenations, and removes unnecessary return statements. Also includes minor logic improvements and code style adjustments in several modules.
Replaces usage of %v with %w in error wrapping for better error propagation in data_init.go. Refactors several functions in login/views.go, publish/list_publish_builder.go, and seo/seo.go to remove unnecessary else branches and simplify control flow, improving readability and maintainability.
Replaces explicit empty slice initializations (e.g., []Type{}) with 'var' declarations for slices and maps across multiple files. This improves code readability and consistency, and in some cases sets slices/maps to nil instead of empty, which can be more idiomatic in Go.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Removed unused selectedItems variable from user role component functions in user_config.go and user.go. Improved error handling in TOTP setup page by checking for errors from otp.NewKeyFromURL and returning appropriate error messages. Simplified buffer handling and error return in OSS file retrieval handler.