Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0ea4da

Browse files
Merge branch 'dceIntegrationTests' of github.com:Workiva/gopherjs into dce4Instances
2 parents 6fe8b6e + df51690 commit a0ea4da

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

compiler/internal/dce/dce_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ func depCount(t *testing.T, decl *testDecl, want int) {
12091209
func equal[T comparable](t *testing.T, got, want T) {
12101210
t.Helper()
12111211
if got != want {
1212-
t.Errorf("Unexpected value was gotten:\t\nexp: %#v\t\ngot: %#v", want, got)
1212+
t.Errorf("Unexpected value was gotten:\n\texp: %#v\n\tgot: %#v", want, got)
12131213
}
12141214
}
12151215

compiler/internal/dce/info.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ type Info struct {
2222
objectFilter string
2323

2424
// methodFilter is the secondary DCE name for a declaration.
25-
// This usually will be empty if objectFilter is empty.
25+
// This will be empty if objectFilter is empty.
2626
// This will be set to a qualified method name if the objectFilter
2727
// can not determine if the declaration is alive on it's own.
2828
// See ./README.md for more information.
@@ -42,14 +42,14 @@ func (d *Info) String() string {
4242
if d.unnamed() {
4343
tags += `[unnamed] `
4444
}
45-
fullName := ``
45+
names := []string{}
4646
if len(d.objectFilter) > 0 {
47-
fullName += d.objectFilter + ` `
47+
names = append(names, d.objectFilter+` `)
4848
}
4949
if len(d.methodFilter) > 0 {
50-
fullName += `& ` + d.methodFilter + ` `
50+
names = append(names, d.methodFilter+` `)
5151
}
52-
return tags + fullName + `-> [` + strings.Join(d.getDeps(), `, `) + `]`
52+
return tags + strings.Join(names, `& `) + `-> [` + strings.Join(d.getDeps(), `, `) + `]`
5353
}
5454

5555
// unnamed returns true if SetName has not been called for this declaration.

0 commit comments

Comments
 (0)