Skip to content

Commit 8c5c2b7

Browse files
Yury Smolskydr2chase
Yury Smolsky
authored andcommitted
cmd/compile: fix TestFormats by using valid formats
CL 142517 has used some formats incorrectly. This change fixes it by using %v for errors and invoking Block.Kind.String(). Format map stays intact. Updates #28177 Change-Id: If53b6cc54ba3c1ffc17b005225787e3b546de404 Reviewed-on: https://go-review.googlesource.com/c/150798 Run-TryBot: Yury Smolsky <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Chase <[email protected]>
1 parent 9098d1d commit 8c5c2b7

File tree

1 file changed

+3
-3
lines changed
  • src/cmd/compile/internal/ssa

1 file changed

+3
-3
lines changed

src/cmd/compile/internal/ssa/html.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) {
893893
if f.laidout {
894894
layout = fmt.Sprintf(" #%d", i)
895895
}
896-
fmt.Fprintf(pipe, `%v [label="%v%s\n%v",id="graph_node_%v_%v",tooltip="%v"];`, b, b, layout, b.Kind, id, b, b.LongString())
896+
fmt.Fprintf(pipe, `%v [label="%v%s\n%v",id="graph_node_%v_%v",tooltip="%v"];`, b, b, layout, b.Kind.String(), id, b, b.LongString())
897897
}
898898
indexOf := make([]int, f.NumBlocks())
899899
for i, b := range f.Blocks {
@@ -942,7 +942,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) {
942942
err = cmd.Wait()
943943
if err != nil {
944944
d.broken = true
945-
fmt.Printf("dot: %s\n%v\n", err, bufErr.String())
945+
fmt.Printf("dot: %v\n%v\n", err, bufErr.String())
946946
return
947947
}
948948

@@ -952,7 +952,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) {
952952
// our fingers, finding '<svg ' and injecting needed attributes after it.
953953
err = d.copyUntil(w, buf, `<svg `)
954954
if err != nil {
955-
fmt.Printf("injecting attributes: %s\n", err)
955+
fmt.Printf("injecting attributes: %v\n", err)
956956
return
957957
}
958958
fmt.Fprintf(w, ` id="%s" onload="makeDraggable(evt)" `, svgID)

0 commit comments

Comments
 (0)