-import "http"
+import "net/http"
...
ctr := new(Counter)
http.Handle("/counter", ctr)
@@ -2925,12 +2925,13 @@ -->package main
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))
diff --git a/doc/effective_go.tmpl b/doc/effective_go.tmpl
index 842f026e1070eaf74e0b3965e01e82a3f4c60075..22e1c1d80a475537ff40fcbafdbbdc42c81b5d40 100644
--- a/doc/effective_go.tmpl
+++ b/doc/effective_go.tmpl
@@ -1934,7 +1934,7 @@ (Keeping with our theme, note how Fprintf can print to an
http.ResponseWriter.)
For reference, here's how to attach such a server to a node on the URL tree.
-import "http"
+import "net/http"
...
ctr := new(Counter)
http.Handle("/counter", ctr)
diff --git a/src/pkg/deps.bash b/src/pkg/deps.bash
index ad752a093ea4ae1c73256f1d35670f600c0a42d0..c4c44f6b4032ad1a91900fa433a2ecbc53e93cbb 100755
--- a/src/pkg/deps.bash
+++ b/src/pkg/deps.bash
@@ -23,36 +23,6 @@ printf("/^(%s)$/\n", x)
}
}')
-# 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
@@ -69,35 +39,6 @@ cut -d '"' -f2 |
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
)
diff --git a/src/pkg/encoding/asn1/Makefile b/src/pkg/encoding/asn1/Makefile
index 692c469878d948506a1de30e59c2ee2d61b2afa3..1c046dc3693628eb1dd8a8d15ea0953d7c2e79d9 100644
--- a/src/pkg/encoding/asn1/Makefile
+++ b/src/pkg/encoding/asn1/Makefile
@@ -4,7 +4,7 @@ # license that can be found in the LICENSE file.
include ../../../Make.inc
-TARG=asn1
+TARG=encoding/asn1
GOFILES=\
asn1.go\
common.go\
diff --git a/src/pkg/encoding/csv/Makefile b/src/pkg/encoding/csv/Makefile
index 7476d816a107680feacf2f882b4ae0f284fd5ae6..9e04c5b90d59962f3a4d067af15b4b00399626b3 100644
--- a/src/pkg/encoding/csv/Makefile
+++ b/src/pkg/encoding/csv/Makefile
@@ -4,7 +4,7 @@ # license that can be found in the LICENSE file.
include ../../../Make.inc
-TARG=csv
+TARG=encoding/csv
GOFILES=\
reader.go\
writer.go\
diff --git a/src/pkg/encoding/gob/Makefile b/src/pkg/encoding/gob/Makefile
index 70ea22f94b1fb8fb89b7d4dcadfe2274756fcd5a..6c7693cba36eb36d33f29fa745016dcf117725a1 100644
--- a/src/pkg/encoding/gob/Makefile
+++ b/src/pkg/encoding/gob/Makefile
@@ -4,7 +4,7 @@ # license that can be found in the LICENSE file.
include ../../../Make.inc
-TARG=gob
+TARG=encoding/gob
GOFILES=\
decode.go\
decoder.go\
diff --git a/src/pkg/encoding/json/Makefile b/src/pkg/encoding/json/Makefile
index 203cf3ca985bf835cb92d4524b3c7fe8cc44d5b9..37223e75e999778c6f38df30f844fc45e4e6b4e3 100644
--- a/src/pkg/encoding/json/Makefile
+++ b/src/pkg/encoding/json/Makefile
@@ -4,7 +4,7 @@ # license that can be found in the LICENSE file.
include ../../../Make.inc
-TARG=json
+TARG=encoding/json
GOFILES=\
decode.go\
encode.go\
diff --git a/src/pkg/encoding/xml/Makefile b/src/pkg/encoding/xml/Makefile
index 731d2ad9597f07900757d759abc1df4f38b4591b..dccb1009fd06f8d7b2ddd3826328928764ae2ebb 100644
--- a/src/pkg/encoding/xml/Makefile
+++ b/src/pkg/encoding/xml/Makefile
@@ -4,7 +4,7 @@ # license that can be found in the LICENSE file.
include ../../../Make.inc
-TARG=xml
+TARG=encoding/xml
GOFILES=\
marshal.go\
diff --git a/src/pkg/html/template/Makefile b/src/pkg/html/template/Makefile
index 57f034614951955c7bbbda820c3ad55e115f48b3..d27601a33b49800f12cedb48d7ca81007515057a 100644
--- a/src/pkg/html/template/Makefile
+++ b/src/pkg/html/template/Makefile
@@ -4,7 +4,7 @@ # license that can be found in the LICENSE file.
include ../../../Make.inc
-TARG=exp/template/html
+TARG=html/template
GOFILES=\
attr.go\
clone.go\
diff --git a/src/pkg/html/template/attr.go b/src/pkg/html/template/attr.go
index 6a36c7b7181104a5feccc8f1a5f9db2e9dd20530..3ea02880d45a67536083e7ff4b2c805234a358ac 100644
--- a/src/pkg/html/template/attr.go
+++ b/src/pkg/html/template/attr.go
@@ -2,7 +2,7 @@ // Copyright 2011 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 html
+package template
import (
"strings"
diff --git a/src/pkg/html/template/clone.go b/src/pkg/html/template/clone.go
index 803a64de12fdc6e55927beffda13cdfad64f4749..d0d8ea46733f4aed2538603f619fec906c275f21 100644
--- a/src/pkg/html/template/clone.go
+++ b/src/pkg/html/template/clone.go
@@ -2,10 +2,10 @@ // Copyright 2011 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 html
+package template
import (
- "template/parse"
+ "text/template/parse"
)
// clone clones a template Node.
diff --git a/src/pkg/html/template/clone_test.go b/src/pkg/html/template/clone_test.go
index 9e557d288064b1c3ddd7708414b8b1cc04d5335b..ed1698acd8b646e8c36c25ca4a372e2477460ca5 100644
--- a/src/pkg/html/template/clone_test.go
+++ b/src/pkg/html/template/clone_test.go
@@ -2,13 +2,13 @@ // Copyright 2011 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 html
+package template
import (
"bytes"
- "template"
- "template/parse"
"testing"
+ "text/template"
+ "text/template/parse"
)
func TestClone(t *testing.T) {
diff --git a/src/pkg/html/template/content.go b/src/pkg/html/template/content.go
index dcaff8c15c638adc08ba8c29f2aae6e551a4d645..d720d4ba6895df1e0a48463f38ad02bd76815ada 100644
--- a/src/pkg/html/template/content.go
+++ b/src/pkg/html/template/content.go
@@ -2,7 +2,7 @@ // Copyright 2011 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 html
+package template
import (
"fmt"
diff --git a/src/pkg/html/template/content_test.go b/src/pkg/html/template/content_test.go
index bee2ed1c1890dddbfa562ed26ca5dfd82587ec4c..c96a521a59c47e9e5ad9be547a11332f01213e47 100644
--- a/src/pkg/html/template/content_test.go
+++ b/src/pkg/html/template/content_test.go
@@ -2,7 +2,7 @@ // Copyright 2011 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 html
+package template
import (
"bytes"
diff --git a/src/pkg/html/template/context.go b/src/pkg/html/template/context.go
index c44df4debc1023e05e8e1b38f7253eb6dcdd7d53..7202221b831d8bc948f5874e8170eab09a30e396 100644
--- a/src/pkg/html/template/context.go
+++ b/src/pkg/html/template/context.go
@@ -2,7 +2,7 @@ // Copyright 2011 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 html
+package template
import (
"fmt"
diff --git a/src/pkg/html/template/css.go b/src/pkg/html/template/css.go
index c26ae78d17fb45f25fe3633f6960f3a8ab8adc6f..b0a2f013d2909b0b8e453e58b6eed459849b628c 100644
--- a/src/pkg/html/template/css.go
+++ b/src/pkg/html/template/css.go
@@ -2,13 +2,13 @@ // Copyright 2011 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 html
+package template
import (
"bytes"
"fmt"
"unicode"
- "utf8"
+ "unicode/utf8"
)
// endsWithCSSKeyword returns whether b ends with an ident that
diff --git a/src/pkg/html/template/css_test.go b/src/pkg/html/template/css_test.go
index b3b83e855d3b47a66834b66196722eeca7295758..0d94bdcf18cda23dcc1473bee5fe459817f5469e 100644
--- a/src/pkg/html/template/css_test.go
+++ b/src/pkg/html/template/css_test.go
@@ -2,7 +2,7 @@ // Copyright 2011 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 html
+package template
import (
"strconv"
diff --git a/src/pkg/html/template/doc.go b/src/pkg/html/template/doc.go
index 8aca42f56b6473c8d02a438590ae69ee8b027a10..0324c9c0ee325115a08f85087de2b2d74d1e18eb 100644
--- a/src/pkg/html/template/doc.go
+++ b/src/pkg/html/template/doc.go
@@ -3,8 +3,9 @@ // Use of this source code is governed by a BSD-style
// 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
@@ -182,4 +183,4 @@ "A developer (or code reviewer) familiar with HTML, CSS, and JavaScript, who
knows that contextual autoescaping happens should be able to look at a {{.}}
and correctly infer what sanitization happens."
*/
-package html
+package template
diff --git a/src/pkg/html/template/error.go b/src/pkg/html/template/error.go
index cb2994bc8a17c928bba499516b88914a5c004f0c..9622d7e48eed8dff1547a2a6150a3728f5c9a74e 100644
--- a/src/pkg/html/template/error.go
+++ b/src/pkg/html/template/error.go
@@ -2,7 +2,7 @@ // Copyright 2011 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 html
+package template
import (
"fmt"
diff --git a/src/pkg/html/template/escape.go b/src/pkg/html/template/escape.go
index e8eae8f174b8a4e81b668b45c33ef3614b8de6c6..8ac07eae24c3fe029791e18577a14c201c1686b4 100644
--- a/src/pkg/html/template/escape.go
+++ b/src/pkg/html/template/escape.go
@@ -2,14 +2,14 @@ // Copyright 2011 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 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
diff --git a/src/pkg/html/template/escape_test.go b/src/pkg/html/template/escape_test.go
index f705947a0e8d111985b8171defa4c259d91cf505..d8bfa321121020dd8d8e65bce99f56df4c41662c 100644
--- a/src/pkg/html/template/escape_test.go
+++ b/src/pkg/html/template/escape_test.go
@@ -2,16 +2,16 @@ // Copyright 2011 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 html
+package template
import (
"bytes"
+ "encoding/json"
"fmt"
- "json"
"strings"
- "template"
- "template/parse"
"testing"
+ "text/template"
+ "text/template/parse"
)
type badMarshaler struct{}
@@ -224,7 +224,7 @@ },
{
"badMarshaller",
`