<code>http.ResponseWriter</code>.)
For reference, here's how to attach such a server to a node on the URL tree.
<pre>
-import "http"
+import "net/http"
...
ctr := new(Counter)
http.Handle("/counter", ctr)
import (
"flag"
- "http"
"log"
- "template"
+ "net/http"
+ "text/template"
)
-var addr = flag.String("addr", ":1718", "http service address") // Q=17, R=18
+var // Q=17, R=18
+addr = flag.String("addr", ":1718", "http service address")
var templ = template.Must(template.New("qr").Parse(templateStr))
<code>http.ResponseWriter</code>.)
For reference, here's how to attach such a server to a node on the URL tree.
<pre>
-import "http"
+import "net/http"
...
ctr := new(Counter)
http.Handle("/counter", ctr)
}
}')
-# Append old names of renamed packages. TODO: clean up after renaming.
-dirpat="$dirpat
-/^(asn1)$/
-/^(big)$/
-/^(cmath)$/
-/^(csv)$/
-/^(exec)$/
-/^(exp\/template\/html)$/
-/^(gob)$/
-/^(http)/
-/^(http\/cgi)$/
-/^(http\/fcgi)$/
-/^(http\/httptest)$/
-/^(http\/pprof)$/
-/^(json)$/
-/^(mail)$/
-/^(rand)$/
-/^(rpc)$/
-/^(scanner)$/
-/^(smtp)$/
-/^(syslog)$/
-/^(tabwriter)$/
-/^(url)$/
-/^(template)$/
-/^(template\/parse)$/
-/^(utf16)$/
-/^(utf8)$/
-/^(xml)$/
-"
-
for dir in $dirs; do (
cd $dir >/dev/null || exit 1
awk "$dirpat" |
grep -v "^$dir\$" |
sed 's/$/.install/' |
- # TODO: rename the dependencies for renamed directories. TODO: clean up after renaming.
- sed 's;^asn1.install$;encoding/asn1.install;
- s;^big.install$;math/big.install;
- s;^cmath.install$;math/cmplx.install;
- s;^csv.install$;encoding/csv.install;
- s;^exec.install$;os/exec.install;
- s;^exp/template/html.install$;html/template.install;
- s;^gob.install$;encoding/gob.install;
- s;^http.install$;net/http.install;
- s;^http/cgi.install$;net/http/cgi.install;
- s;^http/fcgi.install$;net/http/fcgi.install;
- s;^http/httptest.install$;net/http/httptest.install;
- s;^http/pprof.install$;net/http/pprof.install;
- s;^json.install$;encoding/json.install;
- s;^mail.install$;net/mail.install;
- s;^rpc.install$;net/rpc.install;
- s;^rpc/jsonrpc.install$;net/rpc/jsonrpc.install;
- s;^scanner.install$;text/scanner.install;
- s;^smtp.install$;net/smtp.install;
- s;^syslog.install$;log/syslog.install;
- s;^tabwriter.install$;text/tabwriter.install;
- s;^template.install$;text/template.install;
- s;^template/parse.install$;text/template/parse.install;
- s;^rand.install$;math/rand.install;
- s;^url.install$;net/url.install;
- s;^utf16.install$;unicode/utf16.install;
- s;^utf8.install$;unicode/utf8.install;
- s;^xml.install$;encoding/xml.install;' |
- # TODO: end of renamings.
sed 's;^C\.install;runtime/cgo.install;' |
sort -u
)
include ../../../Make.inc
-TARG=asn1
+TARG=encoding/asn1
GOFILES=\
asn1.go\
common.go\
include ../../../Make.inc
-TARG=csv
+TARG=encoding/csv
GOFILES=\
reader.go\
writer.go\
include ../../../Make.inc
-TARG=gob
+TARG=encoding/gob
GOFILES=\
decode.go\
decoder.go\
include ../../../Make.inc
-TARG=json
+TARG=encoding/json
GOFILES=\
decode.go\
encode.go\
include ../../../Make.inc
-TARG=xml
+TARG=encoding/xml
GOFILES=\
marshal.go\
include ../../../Make.inc
-TARG=exp/template/html
+TARG=html/template
GOFILES=\
attr.go\
clone.go\
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"strings"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
- "template/parse"
+ "text/template/parse"
)
// clone clones a template Node.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
- "template"
- "template/parse"
"testing"
+ "text/template"
+ "text/template/parse"
)
func TestClone(t *testing.T) {
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"fmt"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"fmt"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
"fmt"
"unicode"
- "utf8"
+ "unicode/utf8"
)
// endsWithCSSKeyword returns whether b ends with an ident that
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"strconv"
// license that can be found in the LICENSE file.
/*
-Package html is a specialization of package template that automates the
-construction of HTML output that is safe against code injection.
+Package template (html/template) is a specialization of package text/template
+that automates the construction of HTML output that is safe against code
+injection.
Introduction
knows that contextual autoescaping happens should be able to look at a {{.}}
and correctly infer what sanitization happens."
*/
-package html
+package template
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"fmt"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
"fmt"
"html"
- "template"
- "template/parse"
+ "text/template"
+ "text/template/parse"
)
// escape rewrites each action in the template to guarantee that the output is
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
+ "encoding/json"
"fmt"
- "json"
"strings"
- "template"
- "template/parse"
"testing"
+ "text/template"
+ "text/template/parse"
)
type badMarshaler struct{}
{
"badMarshaller",
`<button onclick='alert(1/{{.B}}in numbers)'>`,
- `<button onclick='alert(1/ /* json: error calling MarshalJSON for type *html.badMarshaler: invalid character 'f' looking for beginning of object key string */null in numbers)'>`,
+ `<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: invalid character 'f' looking for beginning of object key string */null in numbers)'>`,
},
{
"jsMarshaller",
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
"fmt"
"strings"
- "utf8"
+ "unicode/utf8"
)
// htmlNospaceEscaper escapes for inclusion in unquoted attribute values.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"html"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
+ "encoding/json"
"fmt"
- "json"
"strings"
- "utf8"
+ "unicode/utf8"
)
// nextJSCtx returns the context that determines whether a slash after the
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"fmt"
"io"
"path/filepath"
- "template"
+ "text/template"
)
// Set is a specialized template.Set that produces a safe HTML document
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"bytes"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package html
+package template
import (
"testing"
include ../../../Make.inc
-TARG=syslog
+TARG=log/syslog
GOFILES=\
syslog.go\
syslog_unix.go\
include ../../../Make.inc
-TARG=big
+TARG=math/big
GOFILES=\
arith.go\
arith_decl.go\
include ../../../Make.inc
-TARG=cmath
+TARG=math/cmplx
GOFILES=\
abs.go\
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// Package cmath provides basic constants and mathematical functions for
+// Package cmplx provides basic constants and mathematical functions for
// complex numbers.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import (
"math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
// Conj returns the complex conjugate of x.
func Conj(x complex128) complex128 { return complex(real(x), -imag(x)) }
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
// Polar returns the absolute value r and phase θ of x,
// such that x = r * e**θi.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-package cmath
+package cmplx
import "math"
include ../../../Make.inc
-TARG=rand
+TARG=math/rand
GOFILES=\
exp.go\
normal.go\
include ../../../Make.inc
-TARG=http
+TARG=net/http
GOFILES=\
chunked.go\
client.go\
include ../../../../Make.inc
-TARG=http/cgi
+TARG=net/http/cgi
GOFILES=\
child.go\
host.go\
include ../../../../Make.inc
-TARG=http/fcgi
+TARG=net/http/fcgi
GOFILES=\
child.go\
fcgi.go\
include ../../../../Make.inc
-TARG=http/httptest
+TARG=net/http/httptest
GOFILES=\
recorder.go\
server.go\
include ../../../../Make.inc
-TARG=http/pprof
+TARG=net/http/pprof
GOFILES=\
pprof.go\
include ../../../Make.inc
-TARG=mail
+TARG=net/mail
GOFILES=\
message.go\
include ../../../Make.inc
-TARG=rpc
+TARG=net/rpc
GOFILES=\
client.go\
debug.go\
include ../../../../Make.inc
-TARG=rpc/jsonrpc
+TARG=net/rpc/jsonrpc
GOFILES=\
client.go\
server.go\
include ../../../Make.inc
-TARG=smtp
+TARG=net/smtp
GOFILES=\
auth.go\
smtp.go\
include ../../../Make.inc
-TARG=url
+TARG=net/url
GOFILES=\
url.go\
include ../../../Make.inc
-TARG=exec
+TARG=os/exec
GOFILES=\
exec.go\
include ../../../Make.inc
-TARG=scanner
+TARG=text/scanner
GOFILES=\
scanner.go\
include ../../../Make.inc
-TARG=tabwriter
+TARG=text/tabwriter
GOFILES=\
tabwriter.go\
include ../../../Make.inc
-TARG=template
+TARG=text/template
GOFILES=\
doc.go\
exec.go\
include ../../../../Make.inc
-TARG=template/parse
+TARG=text/template/parse
GOFILES=\
lex.go\
node.go\
include ../../../Make.inc
-TARG=utf16
+TARG=unicode/utf16
GOFILES=\
utf16.go\
include ../../../Make.inc
-TARG=utf8
+TARG=unicode/utf8
GOFILES=\
string.go\
utf8.go\
package main
import (
- "http"
"io/ioutil" // GCCGO_ERROR "imported and not used"
+ "net/http"
"os"
)