Congratulations on opening your first change. Thank you for your contribution!
Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.
Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.
During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.
To view, visit change 85195. To unsubscribe, or for help writing mail filters, visit settings.
Owen Marshall has uploaded this change for review.
net/textproto: Add an example for textproto.Conn
Add a simple connect/response client to net/textproto
that connects to google.com, reads robots.txt, and
prints the response until EOF.
Change-Id: Id90caa55e9d04377923a8646b3476411969abe9f
---
A src/net/textproto/example_test.go
1 file changed, 37 insertions(+), 0 deletions(-)
diff --git a/src/net/textproto/example_test.go b/src/net/textproto/example_test.go
new file mode 100644
index 0000000..1384268
--- /dev/null
+++ b/src/net/textproto/example_test.go
@@ -0,0 +1,37 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package textproto_test
+
+import (
+ "fmt"
+ "io"
+ "log"
+ "net/textproto"
+)
+
+func ExampleConn() {
+ // Dial a remote server
+ conn, err := textproto.Dial("tcp", "google.com:80")
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Send a HTTP GET to the remote server
+ conn.PrintfLine("GET /robots.txt")
+
+ for {
+ // Read lines until EOF
+ recv, err := conn.ReadLine()
+ if err == io.EOF {
+ break
+ }
+
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ fmt.Println(recv)
+ }
+}
To view, visit change 85195. To unsubscribe, or for help writing mail filters, visit settings.
Owen Marshall uploaded patch set #2 to this change.
net/textproto: Add an example for textproto.Conn
Add a simple connect/response client to net/textproto
that connects to google.com, reads robots.txt, and
prints the response until EOF.
Change-Id: Id90caa55e9d04377923a8646b3476411969abe9f
---
A src/net/textproto/example_test.go
1 file changed, 37 insertions(+), 0 deletions(-)
To view, visit change 85195. To unsubscribe, or for help writing mail filters, visit settings.
added bradfitz as a reviewer (well, an assignee at first, sorry ;)) per https://golang.org/s/owners and GitHub #17555
R=go1.11
Too late for Go 1.10, sorry (even in December). Somebody can review in February.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |