Skip to content
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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

gnolizuh
Copy link

What type of PR is this?

it's a chore pr.

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(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:

@@ -19,7 +19,7 @@ package test
import (
"bytes"
"context"
"io/ioutil"
"io"
Copy link
Contributor

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.
Copy link
Contributor

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
Copy link
Contributor

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")
Copy link
Contributor

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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants