]> Cypherpunks.ru repositories - netstring.git/commitdiff
go fmt v2.3.0
authorSergey Matveev <stargrave@stargrave.org>
Fri, 20 Jan 2023 07:54:20 +0000 (10:54 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Fri, 20 Jan 2023 07:54:20 +0000 (10:54 +0300)
ns.go

diff --git a/ns.go b/ns.go
index a47471198ca93274f7c4b6467386ecbc642b9d38..af43bcebb931a1d996d5442c35034fb2d4c4eb17 100644 (file)
--- a/ns.go
+++ b/ns.go
@@ -21,15 +21,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 // (http://cr.yp.to/proto/netstrings.txt) format for binary string
 // serialization.
 //
-//   var b bytes.Buffer
-//   w := netstring.NewWriter(&b)
-//   n, _ = w.WriteChunk([]byte("hello")) // n is 8, "5:hello,"
-//   n, _ = w.WriteSize(6)                // n is 2
-//   n, _ = w.Write([]byte("wor"))        // n is 3
-//   n, _ = w.Write([]byte("ld!"))        // n is 3, "5:hello,6:world!,"
-//   r := netstring.NewReader(&b)
-//   size, err := r.Next()         // size is 5
-//   r.Discard()                   // skip that chunk
-//   size, err = r.Next()          // size is 6
-//   data, _ := io.ReadAll(r)  // data contains "world!"
+//     var b bytes.Buffer
+//     w := netstring.NewWriter(&b)
+//     n, _ = w.WriteChunk([]byte("hello")) // n is 8, "5:hello,"
+//     n, _ = w.WriteSize(6)                // n is 2
+//     n, _ = w.Write([]byte("wor"))        // n is 3
+//     n, _ = w.Write([]byte("ld!"))        // n is 3, "5:hello,6:world!,"
+//     r := netstring.NewReader(&b)
+//     size, err := r.Next()         // size is 5
+//     r.Discard()                   // skip that chunk
+//     size, err = r.Next()          // size is 6
+//     data, _ := io.ReadAll(r)  // data contains "world!"
 package netstring