1
0
mirror of https://github.com/golang/go synced 2024-11-21 20:54:45 -07:00

renaming_1: hand-edited files for go 1 renaming

This contains the files that required handiwork, mostly
Makefiles with updated TARGs, plus the two packages
with modified package names.
html/template/doc.go needs a separate edit pass.
test/fixedbugs/bug358.go is not legal go so gofix fails on it.

R=rsc
CC=golang-dev
https://golang.org/cl/5340050
This commit is contained in:
Rob Pike 2011-11-08 15:38:47 -08:00
parent e50479ca88
commit 6ab6c49fce
66 changed files with 87 additions and 144 deletions

View File

@ -1996,7 +1996,7 @@ func (ctr *Counter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
<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)
@ -2925,12 +2925,13 @@ An explanation follows.
import (
&#34;flag&#34;
&#34;http&#34;
&#34;log&#34;
&#34;template&#34;
&#34;net/http&#34;
&#34;text/template&#34;
)
var addr = flag.String(&#34;addr&#34;, &#34;:1718&#34;, &#34;http service address&#34;) // Q=17, R=18
var // Q=17, R=18
addr = flag.String(&#34;addr&#34;, &#34;:1718&#34;, &#34;http service address&#34;)
var templ = template.Must(template.New(&#34;qr&#34;).Parse(templateStr))

View File

@ -1934,7 +1934,7 @@ func (ctr *Counter) ServeHTTP(w http.ResponseWriter, req *http.Request) {
<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)

View File

@ -23,36 +23,6 @@ dirpat=$(echo $dirs C | awk '{
}
}')
# 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 @@ for dir in $dirs; do (
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
)

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=asn1
TARG=encoding/asn1
GOFILES=\
asn1.go\
common.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=csv
TARG=encoding/csv
GOFILES=\
reader.go\
writer.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=gob
TARG=encoding/gob
GOFILES=\
decode.go\
decoder.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=json
TARG=encoding/json
GOFILES=\
decode.go\
encode.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=xml
TARG=encoding/xml
GOFILES=\
marshal.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=exp/template/html
TARG=html/template
GOFILES=\
attr.go\
clone.go\

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,10 +2,10 @@
// 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.

View File

@ -2,13 +2,13 @@
// 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) {

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,13 +2,13 @@
// 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

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -3,8 +3,9 @@
// 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 @@ Least Surprise Property
knows that contextual autoescaping happens should be able to look at a {{.}}
and correctly infer what sanitization happens."
*/
package html
package template

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,14 +2,14 @@
// 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

View File

@ -2,16 +2,16 @@
// 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 @@ func TestEscape(t *testing.T) {
{
"badMarshaller",
`<button onclick='alert(1/{{.B}}in numbers)'>`,
`<button onclick='alert(1/ /* json: error calling MarshalJSON for type *html.badMarshaler: invalid character &#39;f&#39; looking for beginning of object key string */null in numbers)'>`,
`<button onclick='alert(1/ /* json: error calling MarshalJSON for type *template.badMarshaler: invalid character &#39;f&#39; looking for beginning of object key string */null in numbers)'>`,
},
{
"jsMarshaller",

View File

@ -2,13 +2,13 @@
// 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.

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,14 +2,14 @@
// 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

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,13 +2,13 @@
// 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

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=syslog
TARG=log/syslog
GOFILES=\
syslog.go\
syslog_unix.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=big
TARG=math/big
GOFILES=\
arith.go\
arith_decl.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=cmath
TARG=math/cmplx
GOFILES=\
abs.go\

View File

@ -2,9 +2,9 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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)) }

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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.

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -2,7 +2,7 @@
// 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"

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=rand
TARG=math/rand
GOFILES=\
exp.go\
normal.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=http
TARG=net/http
GOFILES=\
chunked.go\
client.go\

View File

@ -4,7 +4,7 @@
include ../../../../Make.inc
TARG=http/cgi
TARG=net/http/cgi
GOFILES=\
child.go\
host.go\

View File

@ -4,7 +4,7 @@
include ../../../../Make.inc
TARG=http/fcgi
TARG=net/http/fcgi
GOFILES=\
child.go\
fcgi.go\

View File

@ -4,7 +4,7 @@
include ../../../../Make.inc
TARG=http/httptest
TARG=net/http/httptest
GOFILES=\
recorder.go\
server.go\

View File

@ -4,7 +4,7 @@
include ../../../../Make.inc
TARG=http/pprof
TARG=net/http/pprof
GOFILES=\
pprof.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=mail
TARG=net/mail
GOFILES=\
message.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=rpc
TARG=net/rpc
GOFILES=\
client.go\
debug.go\

View File

@ -4,7 +4,7 @@
include ../../../../Make.inc
TARG=rpc/jsonrpc
TARG=net/rpc/jsonrpc
GOFILES=\
client.go\
server.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=smtp
TARG=net/smtp
GOFILES=\
auth.go\
smtp.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=url
TARG=net/url
GOFILES=\
url.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=exec
TARG=os/exec
GOFILES=\
exec.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=scanner
TARG=text/scanner
GOFILES=\
scanner.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=tabwriter
TARG=text/tabwriter
GOFILES=\
tabwriter.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=template
TARG=text/template
GOFILES=\
doc.go\
exec.go\

View File

@ -4,7 +4,7 @@
include ../../../../Make.inc
TARG=template/parse
TARG=text/template/parse
GOFILES=\
lex.go\
node.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=utf16
TARG=unicode/utf16
GOFILES=\
utf16.go\

View File

@ -4,7 +4,7 @@
include ../../../Make.inc
TARG=utf8
TARG=unicode/utf8
GOFILES=\
string.go\
utf8.go\

View File

@ -10,8 +10,8 @@
package main
import (
"http"
"io/ioutil" // GCCGO_ERROR "imported and not used"
"net/http"
"os"
)