-
Notifications
You must be signed in to change notification settings - Fork 784
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
chore: resolve syntax/spelling/format errors prompted by inspect code tool #1339
base: develop
Are you sure you want to change the base?
Conversation
delete extra spaces
@@ -19,7 +19,7 @@ package test | |||
import ( | |||
"bytes" | |||
"context" | |||
"io/ioutil" | |||
"io" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use ioutil.ReadAll
for compatibility since kitex go module version is 1.13.
@@ -269,7 +269,7 @@ func (b *defaultByteBuffer) AppendBuffer(buf ByteBuffer) (err error) { | |||
return | |||
} | |||
|
|||
// Bytes is used to get the bytes written. | |||
// Bytes are used to get the bytes written. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bytes
is function name so that "is" makes more sense.
@@ -142,7 +142,7 @@ func (a *Arguments) buildFlags(version string) *flag.FlagSet { | |||
e.Apply(f) | |||
} | |||
f.Usage = func() { | |||
fmt.Fprintf(os.Stderr, `Version %s | |||
_, _ = fmt.Fprintf(os.Stderr, `Version %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This belongs to the code style issue. if the linter doesn't report errors, it doesn't need to be modified
@@ -102,7 +101,7 @@ NormalExit: | |||
|
|||
func DeleteKitexYaml() { | |||
// try to read kitex.yaml | |||
data, err := ioutil.ReadFile("kitex.yaml") | |||
data, err := os.ReadFile("kitex.yaml") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
@@ -515,7 +514,7 @@ func (c *converter) persist(res *plugin.Response) error { | |||
if err := os.MkdirAll(path, 0o755); err != nil && !os.IsExist(err) { | |||
return fmt.Errorf("failed to create path '%s': %w", path, err) | |||
} | |||
if err := ioutil.WriteFile(full, content, 0o644); err != nil { | |||
if err := os.WriteFile(full, content, 0o644); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto.
What type of PR is this?
it's a chore pr.
Check the PR title.
(Optional) Translate the PR title into Chinese.
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
zh(optional):
(Optional) Which issue(s) this PR fixes:
(optional) The PR that updates user documentation: