@@ -19,11 +19,12 @@ package compose
19
19
import (
20
20
"context"
21
21
"fmt"
22
- "github.com/compose-spec/compose-go/types"
23
- "github.com/spf13/cobra"
24
22
"os"
25
23
"strconv"
26
24
"strings"
25
+
26
+ "github.com/compose-spec/compose-go/types"
27
+ "github.com/spf13/cobra"
27
28
)
28
29
29
30
type vizOptions struct {
@@ -65,7 +66,7 @@ func vizCommand(p *ProjectOptions) *cobra.Command {
65
66
return cmd
66
67
}
67
68
68
- func runViz (ctx context.Context , opts * vizOptions ) error {
69
+ func runViz (_ context.Context , opts * vizOptions ) error {
69
70
_ , _ = fmt .Fprintln (os .Stderr , "viz command is EXPERIMENTAL" )
70
71
project , err := opts .ToProject (nil )
71
72
if err != nil {
@@ -89,7 +90,7 @@ func runViz(ctx context.Context, opts *vizOptions) error {
89
90
graphBuilder .WriteString ("digraph " + project .Name + " {\n " )
90
91
graphBuilder .WriteString (opts .indentationStr + "layout=dot;\n " )
91
92
addNodes (& graphBuilder , graph , opts )
92
- graphBuilder .WriteRune ('\n' )
93
+ graphBuilder .WriteByte ('\n' )
93
94
addEdges (& graphBuilder , graph , opts )
94
95
graphBuilder .WriteString ("}\n " )
95
96
@@ -127,10 +128,10 @@ func addNodes(graphBuilder *strings.Builder, graph vizGraph, opts *vizOptions) *
127
128
graphBuilder .WriteString ("<br/>" )
128
129
if len (portConfig .HostIP ) > 0 {
129
130
graphBuilder .WriteString (portConfig .HostIP )
130
- graphBuilder .WriteRune (':' )
131
+ graphBuilder .WriteByte (':' )
131
132
}
132
133
graphBuilder .WriteString (portConfig .Published )
133
- graphBuilder .WriteRune (':' )
134
+ graphBuilder .WriteByte (':' )
134
135
graphBuilder .WriteString (strconv .Itoa (int (portConfig .Target )))
135
136
graphBuilder .WriteString (" (" )
136
137
graphBuilder .WriteString (portConfig .Protocol )
@@ -172,9 +173,9 @@ func addEdges(graphBuilder *strings.Builder, graph vizGraph, opts *vizOptions) *
172
173
173
174
// writeQuoted writes "str" to builder
174
175
func writeQuoted (builder * strings.Builder , str string ) {
175
- builder .WriteRune ('"' )
176
+ builder .WriteByte ('"' )
176
177
builder .WriteString (str )
177
- builder .WriteRune ('"' )
178
+ builder .WriteByte ('"' )
178
179
}
179
180
180
181
// preferredIndentationStr returns a single string given the indentation preference
0 commit comments