Skip to content

Commit 2bc6a45

Browse files
BenjaminGuzmanndeloof
authored andcommitted
Replaced calls to WriteRune with WriteByte and reformatted imports
Signed-off-by: Benjamín Guzmán <[email protected]>
1 parent 2268d1e commit 2bc6a45

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

cmd/compose/viz.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ package compose
1919
import (
2020
"context"
2121
"fmt"
22-
"github.com/compose-spec/compose-go/types"
23-
"github.com/spf13/cobra"
2422
"os"
2523
"strconv"
2624
"strings"
25+
26+
"github.com/compose-spec/compose-go/types"
27+
"github.com/spf13/cobra"
2728
)
2829

2930
type vizOptions struct {
@@ -65,7 +66,7 @@ func vizCommand(p *ProjectOptions) *cobra.Command {
6566
return cmd
6667
}
6768

68-
func runViz(ctx context.Context, opts *vizOptions) error {
69+
func runViz(_ context.Context, opts *vizOptions) error {
6970
_, _ = fmt.Fprintln(os.Stderr, "viz command is EXPERIMENTAL")
7071
project, err := opts.ToProject(nil)
7172
if err != nil {
@@ -89,7 +90,7 @@ func runViz(ctx context.Context, opts *vizOptions) error {
8990
graphBuilder.WriteString("digraph " + project.Name + " {\n")
9091
graphBuilder.WriteString(opts.indentationStr + "layout=dot;\n")
9192
addNodes(&graphBuilder, graph, opts)
92-
graphBuilder.WriteRune('\n')
93+
graphBuilder.WriteByte('\n')
9394
addEdges(&graphBuilder, graph, opts)
9495
graphBuilder.WriteString("}\n")
9596

@@ -127,10 +128,10 @@ func addNodes(graphBuilder *strings.Builder, graph vizGraph, opts *vizOptions) *
127128
graphBuilder.WriteString("<br/>")
128129
if len(portConfig.HostIP) > 0 {
129130
graphBuilder.WriteString(portConfig.HostIP)
130-
graphBuilder.WriteRune(':')
131+
graphBuilder.WriteByte(':')
131132
}
132133
graphBuilder.WriteString(portConfig.Published)
133-
graphBuilder.WriteRune(':')
134+
graphBuilder.WriteByte(':')
134135
graphBuilder.WriteString(strconv.Itoa(int(portConfig.Target)))
135136
graphBuilder.WriteString(" (")
136137
graphBuilder.WriteString(portConfig.Protocol)
@@ -172,9 +173,9 @@ func addEdges(graphBuilder *strings.Builder, graph vizGraph, opts *vizOptions) *
172173

173174
// writeQuoted writes "str" to builder
174175
func writeQuoted(builder *strings.Builder, str string) {
175-
builder.WriteRune('"')
176+
builder.WriteByte('"')
176177
builder.WriteString(str)
177-
builder.WriteRune('"')
178+
builder.WriteByte('"')
178179
}
179180

180181
// preferredIndentationStr returns a single string given the indentation preference

0 commit comments

Comments
 (0)