Skip to content

Commit

Permalink
fix fmt.Fprintf lint
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmshsh committed Sep 15, 2023
1 parent 34e4af1 commit b966cad
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/dubboctl/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func runBuildCmd(cmd *cobra.Command, newClient ClientFactory) error {
client, done := newClient(clientOptions...)
defer done()
if f.Built() && !cfg.Force {
fmt.Fprintf(cmd.OutOrStdout(), "The Application is up to date, If you still want to build, use `--force true`\n")
fmt.Fprintln(cmd.OutOrStdout(), "The Application is up to date, If you still want to build, use `--force true`")
return nil
}
if f, err = client.Build(cmd.Context(), f); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion app/dubboctl/cmd/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func isValidTemplate(client *dubbo.Client, runtime, template string) bool {

func noRuntimeError(client *dubbo.Client) error {
b := strings.Builder{}
fmt.Fprintf(&b, "Required flag \"language\" not set.\n")
fmt.Fprintln(&b, "Required flag \"language\" not set.")
fmt.Fprintln(&b, "Available language runtimes are:")
runtimes, err := client.Runtimes()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions app/dubboctl/cmd/prompt/prompt.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ func NewPromptForCredentials(in io.Reader, out, errOut io.Writer) func(registry
} else {
reader := bufio.NewReader(in)

fmt.Fprintf(out, "Username: ")
fmt.Fprint(out, "Username: ")
u, err := reader.ReadString('\n')
if err != nil {
return docker.Credentials{}, err
}
u = strings.Trim(u, "\r\n")

fmt.Fprintf(out, "Password: ")
fmt.Fprint(out, "Password: ")
p, err := reader.ReadString('\n')
if err != nil {
return docker.Credentials{}, err
Expand Down
2 changes: 1 addition & 1 deletion app/dubboctl/internal/dubbo/dubbo.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ func (f *Dubbo) EnsureDockerfile(cmd *cobra.Command) (err error) {
dockerfilepath := filepath.Join(f.Root, Dockerfile)
dockerfilebytes, ok := DockerfileByRuntime[f.Runtime]
if !ok {
fmt.Fprintf(cmd.OutOrStdout(), "The runtime of your current project is not one of Java or go. We cannot help you generate a Dockerfile template.\n")
fmt.Fprintln(cmd.OutOrStdout(), "The runtime of your current project is not one of Java or go. We cannot help you generate a Dockerfile template.")
return
}
if err = os.WriteFile(dockerfilepath, []byte(dockerfilebytes), 0o644); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion generate/templates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func main() {
srcOut := bufio.NewWriter(f)
defer srcOut.Flush()

_, err = fmt.Fprintf(srcOut, "// Code generated by go generate; DO NOT EDIT.\npackage generate\n\nvar TemplatesZip = []byte{")
_, err = fmt.Fprintln(srcOut, "// Code generated by go generate; DO NOT EDIT.\npackage generate\n\nvar TemplatesZip = []byte{")
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit b966cad

Please sign in to comment.