Merged
Conversation
in some cases, err.Error() will be called when err is nil, fix it;
pkg/common/utils/mysql/mysql.go
Outdated
| if _, ok := m[COMPUTE_GROUP_ID]; !ok { | ||
| klog.Errorf("GetBackendsByComputeGroupId backends tag get compute_group_name failed, tag: %s, err: %s\n", be.Tag, err.Error()) | ||
| return nil, err | ||
| return nil, fmt.Errorf("GetBackendsByComputeGroupId backends tag get compute_group_name failed, tag: %s, err: no compute_group_id field found", be.Tag) |
Contributor
There was a problem hiding this comment.
'klog.Errorf' needs to print the error log, here you need to keep using this method to print this error log
| m, err := ResolveConfigMaps(tests, dorisv1.Component_FE) | ||
| if err != nil || len(m) == 0 { | ||
| t.Errorf("resolve configmaps faild, len=%d, err=%s", len(m), err.Error()) | ||
| t.Errorf("resolve configmaps faild, len=%d, err=%#v", len(m), err) |
Contributor
There was a problem hiding this comment.
Try not to use %#v to print structure instances. This may cause err null pointer problems and require post-processing after checking for null.
Open
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
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.
in some cases, err.Error() will be called when err is nil, fix it;
What problem does this PR solve?
Issue Number: close #439
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)