From 19309779ac5e2f5a2fd3cbb34421dafb2855ac21 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 3 Feb 2022 14:12:08 -0500 Subject: all: gofmt main repo [This CL is part of a sequence implementing the proposal #51082. The design doc is at https://go.dev/s/godocfmt-design.] Run the updated gofmt, which reformats doc comments, on the main repository. Vendored files are excluded. For #51082. Change-Id: I7332f099b60f716295fb34719c98c04eb1a85407 Reviewed-on: https://go-review.googlesource.com/c/go/+/384268 Reviewed-by: Jonathan Amsterdam Reviewed-by: Ian Lance Taylor --- src/encoding/gob/debug.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/encoding/gob/debug.go') diff --git a/src/encoding/gob/debug.go b/src/encoding/gob/debug.go index c989ab1ad6..dc572fc11e 100644 --- a/src/encoding/gob/debug.go +++ b/src/encoding/gob/debug.go @@ -215,6 +215,7 @@ func (deb *debugger) uint64() uint64 { } // GobStream: +// // DelimitedMessage* (until EOF) func (deb *debugger) gobStream() { // Make sure we're single-threaded through here. @@ -226,6 +227,7 @@ func (deb *debugger) gobStream() { } // DelimitedMessage: +// // uint(lengthOfMessage) Message func (deb *debugger) delimitedMessage(indent tab) bool { for { @@ -261,12 +263,19 @@ func (deb *debugger) loadBlock(eofOK bool) int { } // Message: +// // TypeSequence TypedValue +// // TypeSequence +// // (TypeDefinition DelimitedTypeDefinition*)? +// // DelimitedTypeDefinition: +// // uint(lengthOfTypeDefinition) TypeDefinition +// // TypedValue: +// // int(typeId) Value func (deb *debugger) message(indent tab) bool { for { @@ -351,6 +360,7 @@ func (deb *debugger) delta(expect int) int { } // TypeDefinition: +// // [int(-typeId) (already read)] encodingOfWireType func (deb *debugger) typeDefinition(indent tab, id typeId) { deb.dump("type definition for id %d", id) @@ -437,6 +447,7 @@ func (deb *debugger) typeDefinition(indent tab, id typeId) { } // Value: +// // SingletonValue | StructValue func (deb *debugger) value(indent tab, id typeId) { wire, ok := deb.wireType[id] @@ -448,6 +459,7 @@ func (deb *debugger) value(indent tab, id typeId) { } // SingletonValue: +// // uint(0) FieldValue func (deb *debugger) singletonValue(indent tab, id typeId) { deb.dump("Singleton value") @@ -465,6 +477,7 @@ func (deb *debugger) singletonValue(indent tab, id typeId) { } // InterfaceValue: +// // NilInterfaceValue | NonNilInterfaceValue func (deb *debugger) interfaceValue(indent tab) { deb.dump("Start of interface value") @@ -476,6 +489,7 @@ func (deb *debugger) interfaceValue(indent tab) { } // NilInterfaceValue: +// // uint(0) [already read] func (deb *debugger) nilInterfaceValue(indent tab) int { fmt.Fprintf(os.Stderr, "%snil interface\n", indent) @@ -483,12 +497,19 @@ func (deb *debugger) nilInterfaceValue(indent tab) int { } // NonNilInterfaceValue: +// // ConcreteTypeName TypeSequence InterfaceContents +// // ConcreteTypeName: +// // uint(lengthOfName) [already read=n] name +// // InterfaceContents: +// // int(concreteTypeId) DelimitedValue +// // DelimitedValue: +// // uint(length) Value func (deb *debugger) nonNilInterfaceValue(indent tab, nameLen int) { // ConcreteTypeName @@ -549,6 +570,7 @@ func (deb *debugger) printWireType(indent tab, wire *wireType) { // fieldValue prints a value of any type, such as a struct field. // FieldValue: +// // builtinValue | ArrayValue | MapValue | SliceValue | StructValue | InterfaceValue func (deb *debugger) fieldValue(indent tab, id typeId) { _, ok := builtinIdToType[id] @@ -622,6 +644,7 @@ func (deb *debugger) printBuiltin(indent tab, id typeId) { } // ArrayValue: +// // uint(n) FieldValue*n func (deb *debugger) arrayValue(indent tab, wire *wireType) { elemId := wire.ArrayT.Elem @@ -636,6 +659,7 @@ func (deb *debugger) arrayValue(indent tab, wire *wireType) { } // MapValue: +// // uint(n) (FieldValue FieldValue)*n [n (key, value) pairs] func (deb *debugger) mapValue(indent tab, wire *wireType) { keyId := wire.MapT.Key @@ -649,6 +673,7 @@ func (deb *debugger) mapValue(indent tab, wire *wireType) { } // SliceValue: +// // uint(n) (n FieldValue) func (deb *debugger) sliceValue(indent tab, wire *wireType) { elemId := wire.SliceT.Elem @@ -662,6 +687,7 @@ func (deb *debugger) sliceValue(indent tab, wire *wireType) { } // StructValue: +// // (uint(fieldDelta) FieldValue)* func (deb *debugger) structValue(indent tab, id typeId) { deb.dump("Start of struct value of %q id=%d\n<<\n", id.name(), id) @@ -692,6 +718,7 @@ func (deb *debugger) structValue(indent tab, id typeId) { } // GobEncoderValue: +// // uint(n) byte*n func (deb *debugger) gobEncoderValue(indent tab, id typeId) { len := deb.uint64() -- cgit v1.3-5-g9baa