mirror of
https://github.com/golang/go
synced 2024-11-20 00:04:43 -07:00
html/template, net/http, websocket: fix import paths in comments
R=golang-dev CC=golang-dev, rsc https://golang.org/cl/5411048
This commit is contained in:
parent
29e3ef88af
commit
5b9d7825ed
@ -29,7 +29,7 @@ trusted, while Execute's data parameter is not. More details are provided below.
|
|||||||
|
|
||||||
Example
|
Example
|
||||||
|
|
||||||
import "template"
|
import "text/template"
|
||||||
...
|
...
|
||||||
t, err := (&template.Set{}).Parse(`{{define "T"}}Hello, {{.}}!{{end}}`)
|
t, err := (&template.Set{}).Parse(`{{define "T"}}Hello, {{.}}!{{end}}`)
|
||||||
err = t.Execute(out, "T", "<script>alert('you have been pwned')</script>")
|
err = t.Execute(out, "T", "<script>alert('you have been pwned')</script>")
|
||||||
|
@ -1013,8 +1013,8 @@ func (srv *Server) Serve(l net.Listener) error {
|
|||||||
// package main
|
// package main
|
||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
// "http"
|
|
||||||
// "io"
|
// "io"
|
||||||
|
// "net/http"
|
||||||
// "log"
|
// "log"
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
@ -1044,8 +1044,8 @@ func ListenAndServe(addr string, handler Handler) error {
|
|||||||
// A trivial example server is:
|
// A trivial example server is:
|
||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
// "http"
|
|
||||||
// "log"
|
// "log"
|
||||||
|
// "net/http"
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func handler(w http.ResponseWriter, req *http.Request) {
|
// func handler(w http.ResponseWriter, req *http.Request) {
|
||||||
|
@ -72,8 +72,8 @@ A trivial example client:
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"http"
|
|
||||||
"log"
|
"log"
|
||||||
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"websocket"
|
"websocket"
|
||||||
)
|
)
|
||||||
|
@ -60,8 +60,8 @@ A trivial example server:
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"http"
|
|
||||||
"io"
|
"io"
|
||||||
|
"net/http"
|
||||||
"websocket"
|
"websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user