Skip to content

Commit ccff9d4

Browse files
alirezaarzehgargopherbot
authored andcommitted
x/arch: silent go vet warnings
go vet -all ./... arm/armspec/spec.go:584:26: rsc.io/pdf.Text struct literal uses unkeyed fields arm64/arm64spec/spec.go:688:26: rsc.io/pdf.Text struct literal uses unkeyed fields loong64/loong64spec/spec.go:361:26: rsc.io/pdf.Text struct literal uses unkeyed fields ppc64/ppc64map/map.go:290:5: unreachable code ppc64/ppc64spec/spec.go:468:26: rsc.io/pdf.Text struct literal uses unkeyed fields s390x/s390xmap/map.go:218:5: unreachable code s390x/s390xspec/spec.go:1045:26: rsc.io/pdf.Text struct literal uses unkeyed fields x86/x86spec/parse.go:513:26: rsc.io/pdf.Text struct literal uses unkeyed fields Change-Id: I4f7e29c80231ebfc5287e0d5bb57edae5b712603 Reviewed-on: https://go-review.googlesource.com/c/arch/+/642738 Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Cherry Mui <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Commit-Queue: Ian Lance Taylor <[email protected]>
1 parent bde81be commit ccff9d4

File tree

9 files changed

+55
-12
lines changed

9 files changed

+55
-12
lines changed

arm/armspec/spec.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
581581
f := ck.Font
582582
f = strings.TrimSuffix(f, ",Italic")
583583
f = strings.TrimSuffix(f, "-Italic")
584-
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
584+
words = append(words, pdf.Text{
585+
Font: f,
586+
FontSize: ck.FontSize,
587+
X: ck.X,
588+
Y: ck.Y,
589+
W: end - ck.X,
590+
S: s,
591+
})
585592
k = l
586593
}
587594
i = j

arm64/arm64spec/spec.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
685685
f := ck.Font
686686
f = strings.TrimSuffix(f, ",Italic")
687687
f = strings.TrimSuffix(f, "-Italic")
688-
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
688+
words = append(words, pdf.Text{
689+
Font: f,
690+
FontSize: ck.FontSize,
691+
X: ck.X,
692+
Y: ck.Y,
693+
W: end - ck.X,
694+
S: s,
695+
})
689696
k = l
690697
}
691698
i = j

loong64/loong64spec/spec.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
358358
break
359359
}
360360
f := ck.Font
361-
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
361+
words = append(words, pdf.Text{
362+
Font: f,
363+
FontSize: ck.FontSize,
364+
X: ck.X,
365+
Y: ck.Y,
366+
W: end - ck.X,
367+
S: s,
368+
})
362369
k = l
363370
}
364371
i = j

ppc64/ppc64map/map.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"flag"
2525
"fmt"
2626
gofmt "go/format"
27-
asm "golang.org/x/arch/ppc64/ppc64asm"
2827
"log"
2928
"math/bits"
3029
"os"
@@ -33,6 +32,8 @@ import (
3332
"strconv"
3433
"strings"
3534
"text/template"
35+
36+
asm "golang.org/x/arch/ppc64/ppc64asm"
3637
)
3738

3839
var format = flag.String("fmt", "text", "output format: text, decoder, asm")
@@ -287,7 +288,6 @@ func parseFields(encoding, text string, word int8) Args {
287288
if j < 0 {
288289
fmt.Fprintf(os.Stderr, "%s: wrong %d-th encoding field: %q\n", text, i, f)
289290
panic("Invalid encoding entry.")
290-
continue
291291
}
292292
k := strings.Index(f[j+1:], " ")
293293
if k >= 0 {

ppc64/ppc64spec/spec.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
465465
f := ck.Font
466466
f = strings.TrimSuffix(f, ",Italic")
467467
f = strings.TrimSuffix(f, "-Italic")
468-
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
468+
words = append(words, pdf.Text{
469+
Font: f,
470+
FontSize: ck.FontSize,
471+
X: ck.X,
472+
Y: ck.Y,
473+
W: end - ck.X,
474+
S: s,
475+
})
469476
k = l
470477
}
471478
i = j

s390x/s390xmap/map.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ import (
2424
"flag"
2525
"fmt"
2626
gofmt "go/format"
27-
asm "golang.org/x/arch/s390x/s390xasm"
2827
"log"
2928
"os"
3029
"regexp"
3130
"strconv"
3231
"strings"
32+
33+
asm "golang.org/x/arch/s390x/s390xasm"
3334
)
3435

3536
var format = flag.String("fmt", "text", "output format: text, decoder, asm")
@@ -215,7 +216,6 @@ func parseFields(encoding, text string) Args {
215216
if j < 0 {
216217
fmt.Fprintf(os.Stderr, "%s: wrong %d-th encoding field: %q\n", text, i, f)
217218
panic("Invalid encoding entry.")
218-
continue
219219
}
220220
off, err = strconv.Atoi(f[j+1:])
221221
if err != nil {

s390x/s390xspec/spec.go

+10-2
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ import (
3030
"log"
3131
"math"
3232
"os"
33-
"rsc.io/pdf"
3433
"sort"
3534
"strconv"
3635
"strings"
36+
37+
"rsc.io/pdf"
3738
)
3839

3940
type Inst struct {
@@ -1042,7 +1043,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
10421043
f := ck.Font
10431044
f = strings.TrimSuffix(f, ",Italic")
10441045
f = strings.TrimSuffix(f, "-Italic")
1045-
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
1046+
words = append(words, pdf.Text{
1047+
Font: f,
1048+
FontSize: ck.FontSize,
1049+
X: ck.X,
1050+
Y: ck.Y,
1051+
W: end - ck.X,
1052+
S: s,
1053+
})
10461054
k = l
10471055
}
10481056
i = j

x86/x86asm/tables.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x86/x86spec/parse.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
510510
f := ck.Font
511511
f = strings.TrimSuffix(f, ",Italic")
512512
f = strings.TrimSuffix(f, "-Italic")
513-
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end, s})
513+
words = append(words, pdf.Text{
514+
Font: f,
515+
FontSize: ck.FontSize,
516+
X: ck.X,
517+
Y: ck.Y,
518+
W: end,
519+
S: s,
520+
})
514521
k = l
515522
}
516523
i = j

0 commit comments

Comments
 (0)