mirror of https://github.com/golang/go.git
all: run gofmt
Change-Id: I0af1903ed1e4f2bf4ea273847b024520c577ef6d Reviewed-on: https://go-review.googlesource.com/c/go/+/642496 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
66e6f5c920
commit
77f5ecef3a
|
|
@ -12,24 +12,24 @@ import (
|
|||
)
|
||||
|
||||
var escapeTests = []struct {
|
||||
Path string
|
||||
Escaped string
|
||||
}{
|
||||
{"foo/bar/v1", "foo/bar/v1"},
|
||||
{"foo/bar/v.1", "foo/bar/v%2e1"},
|
||||
{"f.o.o/b.a.r/v1", "f.o.o/b.a.r/v1"},
|
||||
{"f.o.o/b.a.r/v.1", "f.o.o/b.a.r/v%2e1"},
|
||||
{"f.o.o/b.a.r/v..1", "f.o.o/b.a.r/v%2e%2e1"},
|
||||
{"f.o.o/b.a.r/v..1.", "f.o.o/b.a.r/v%2e%2e1%2e"},
|
||||
{"f.o.o/b.a.r/v%1", "f.o.o/b.a.r/v%251"},
|
||||
{"runtime", "runtime"},
|
||||
{"sync/atomic", "sync/atomic"},
|
||||
{"golang.org/x/tools/godoc", "golang.org/x/tools/godoc"},
|
||||
{"foo.bar/baz.quux", "foo.bar/baz%2equux"},
|
||||
{"", ""},
|
||||
{"%foo%bar", "%25foo%25bar"},
|
||||
{"\x01\x00\x7F☺", "%01%00%7f%e2%98%ba"},
|
||||
}
|
||||
Path string
|
||||
Escaped string
|
||||
}{
|
||||
{"foo/bar/v1", "foo/bar/v1"},
|
||||
{"foo/bar/v.1", "foo/bar/v%2e1"},
|
||||
{"f.o.o/b.a.r/v1", "f.o.o/b.a.r/v1"},
|
||||
{"f.o.o/b.a.r/v.1", "f.o.o/b.a.r/v%2e1"},
|
||||
{"f.o.o/b.a.r/v..1", "f.o.o/b.a.r/v%2e%2e1"},
|
||||
{"f.o.o/b.a.r/v..1.", "f.o.o/b.a.r/v%2e%2e1%2e"},
|
||||
{"f.o.o/b.a.r/v%1", "f.o.o/b.a.r/v%251"},
|
||||
{"runtime", "runtime"},
|
||||
{"sync/atomic", "sync/atomic"},
|
||||
{"golang.org/x/tools/godoc", "golang.org/x/tools/godoc"},
|
||||
{"foo.bar/baz.quux", "foo.bar/baz%2equux"},
|
||||
{"", ""},
|
||||
{"%foo%bar", "%25foo%25bar"},
|
||||
{"\x01\x00\x7F☺", "%01%00%7f%e2%98%ba"},
|
||||
}
|
||||
|
||||
func TestPathToPrefix(t *testing.T) {
|
||||
for _, tc := range escapeTests {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ import (
|
|||
"bufio"
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// IsSerialized returns true if r is a serialized Profile.
|
||||
|
|
|
|||
|
|
@ -52,4 +52,3 @@ func emptyProfile() *Profile {
|
|||
func WeightInPercentage(value int64, total int64) float64 {
|
||||
return (float64(value) / float64(total)) * 100
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,25 +67,25 @@ func TestRoundTrip(t *testing.T) {
|
|||
NamedEdgeMap: NamedEdgeMap{
|
||||
ByWeight: []NamedCallEdge{
|
||||
{
|
||||
CallerName: "a",
|
||||
CalleeName: "b",
|
||||
CallerName: "a",
|
||||
CalleeName: "b",
|
||||
CallSiteOffset: 14,
|
||||
},
|
||||
{
|
||||
CallerName: "c",
|
||||
CalleeName: "d",
|
||||
CallerName: "c",
|
||||
CalleeName: "d",
|
||||
CallSiteOffset: 15,
|
||||
},
|
||||
},
|
||||
Weight: map[NamedCallEdge]int64{
|
||||
{
|
||||
CallerName: "a",
|
||||
CalleeName: "b",
|
||||
CallerName: "a",
|
||||
CalleeName: "b",
|
||||
CallSiteOffset: 14,
|
||||
}: 2,
|
||||
{
|
||||
CallerName: "c",
|
||||
CalleeName: "d",
|
||||
CallerName: "c",
|
||||
CalleeName: "d",
|
||||
CallSiteOffset: 15,
|
||||
}: 1,
|
||||
},
|
||||
|
|
@ -157,8 +157,8 @@ func constructFuzzProfile(t *testing.T, b []byte) *Profile {
|
|||
}
|
||||
|
||||
edge := NamedCallEdge{
|
||||
CallerName: caller,
|
||||
CalleeName: callee,
|
||||
CallerName: caller,
|
||||
CalleeName: callee,
|
||||
CallSiteOffset: int(line),
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -640,11 +640,11 @@ func TestIssue68387(t *testing.T) {
|
|||
if tok3, err = dec.RawToken(); err != io.EOF || tok3 != nil {
|
||||
t.Fatalf("Missed EOF")
|
||||
}
|
||||
s := StartElement{Name{"", "item"}, []Attr{Attr{Name{"","b"}, "]]>"}}}
|
||||
s := StartElement{Name{"", "item"}, []Attr{Attr{Name{"", "b"}, "]]>"}}}
|
||||
if !reflect.DeepEqual(tok1.(StartElement), s) {
|
||||
t.Error("Wrong start element")
|
||||
}
|
||||
e := EndElement{Name{"","item"}}
|
||||
e := EndElement{Name{"", "item"}}
|
||||
if tok2.(EndElement) != e {
|
||||
t.Error("Wrong end element")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6322,12 +6322,12 @@ func TestMapOfGCBigKey(t *testing.T) {
|
|||
const n = 100
|
||||
m := MakeMap(mt)
|
||||
for i := 0; i < n; i++ {
|
||||
kv := KV{int64(i), int64(i+1)}
|
||||
kv := KV{int64(i), int64(i + 1)}
|
||||
m.SetMapIndex(ValueOf(kv), ValueOf(kv))
|
||||
}
|
||||
|
||||
for i := 0; i < n; i++ {
|
||||
kv := KV{int64(i), int64(i+1)}
|
||||
kv := KV{int64(i), int64(i + 1)}
|
||||
elem := m.MapIndex(ValueOf(kv)).Interface().(KV)
|
||||
if elem != kv {
|
||||
t.Errorf("lost m[%v] = %v, want %v", kv, elem, kv)
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ func TestTracebackSystem(t *testing.T) {
|
|||
t.Skip("Can't read source code for this file on Android")
|
||||
}
|
||||
|
||||
tests := []struct{
|
||||
tests := []struct {
|
||||
name string
|
||||
want string
|
||||
}{
|
||||
|
|
@ -326,7 +326,7 @@ func parseStackPCs(crash string) ([]uintptr, error) {
|
|||
continue
|
||||
}
|
||||
|
||||
pc = pc-parentSentinel+childSentinel
|
||||
pc = pc - parentSentinel + childSentinel
|
||||
|
||||
// If the previous frame was sigpanic, then this frame
|
||||
// was a trap (e.g., SIGSEGV).
|
||||
|
|
|
|||
Loading…
Reference in New Issue