mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
gofmt: experiment: align values in map composites where possible
- gofmt -w src misc - looking for feedback R=rsc, r CC=golang-dev https://golang.org/cl/223076
This commit is contained in:
parent
36ea8bb7bf
commit
f44fa9b4c7
72 changed files with 1870 additions and 1836 deletions
|
|
@ -145,8 +145,8 @@ func walk(x interface{}, p *Prog, context string) {
|
||||||
}
|
}
|
||||||
p.Crefs = p.Crefs[0 : i+1]
|
p.Crefs = p.Crefs[0 : i+1]
|
||||||
p.Crefs[i] = &Cref{
|
p.Crefs[i] = &Cref{
|
||||||
Name: sel.Sel.Name(),
|
Name: sel.Sel.Name(),
|
||||||
Expr: n,
|
Expr: n,
|
||||||
Context: context,
|
Context: context,
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|
|
||||||
|
|
@ -389,14 +389,14 @@ func base(dt dwarf.Type) dwarf.Type {
|
||||||
|
|
||||||
// Map from dwarf text names to aliases we use in package "C".
|
// Map from dwarf text names to aliases we use in package "C".
|
||||||
var cnameMap = map[string]string{
|
var cnameMap = map[string]string{
|
||||||
"long int": "long",
|
"long int": "long",
|
||||||
"long unsigned int": "ulong",
|
"long unsigned int": "ulong",
|
||||||
"unsigned int": "uint",
|
"unsigned int": "uint",
|
||||||
"short unsigned int": "ushort",
|
"short unsigned int": "ushort",
|
||||||
"short int": "short",
|
"short int": "short",
|
||||||
"long long int": "longlong",
|
"long long int": "longlong",
|
||||||
"long long unsigned int": "ulonglong",
|
"long long unsigned int": "ulonglong",
|
||||||
"signed char": "schar",
|
"signed char": "schar",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type returns a *Type with the same memory layout as
|
// Type returns a *Type with the same memory layout as
|
||||||
|
|
@ -654,10 +654,10 @@ func (c *typeConv) FuncArg(dtype dwarf.Type) *Type {
|
||||||
// Arrays are passed implicitly as pointers in C.
|
// Arrays are passed implicitly as pointers in C.
|
||||||
// In Go, we must be explicit.
|
// In Go, we must be explicit.
|
||||||
return &Type{
|
return &Type{
|
||||||
Size: c.ptrSize,
|
Size: c.ptrSize,
|
||||||
Align: c.ptrSize,
|
Align: c.ptrSize,
|
||||||
Go: &ast.StarExpr{X: t.Go},
|
Go: &ast.StarExpr{X: t.Go},
|
||||||
C: t.C + "*",
|
C: t.C + "*",
|
||||||
}
|
}
|
||||||
case *dwarf.TypedefType:
|
case *dwarf.TypedefType:
|
||||||
// C has much more relaxed rules than Go for
|
// C has much more relaxed rules than Go for
|
||||||
|
|
@ -703,7 +703,7 @@ func (c *typeConv) FuncType(dtype *dwarf.FuncType) *FuncType {
|
||||||
Params: p,
|
Params: p,
|
||||||
Result: r,
|
Result: r,
|
||||||
Go: &ast.FuncType{
|
Go: &ast.FuncType{
|
||||||
Params: &ast.FieldList{List: gp},
|
Params: &ast.FieldList{List: gp},
|
||||||
Results: &ast.FieldList{List: gr},
|
Results: &ast.FieldList{List: gr},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -723,7 +723,7 @@ func (c *typeConv) Opaque(n int64) ast.Expr {
|
||||||
// Expr for integer n.
|
// Expr for integer n.
|
||||||
func (c *typeConv) intExpr(n int64) ast.Expr {
|
func (c *typeConv) intExpr(n int64) ast.Expr {
|
||||||
return &ast.BasicLit{
|
return &ast.BasicLit{
|
||||||
Kind: token.INT,
|
Kind: token.INT,
|
||||||
Value: []byte(strconv.Itoa64(n)),
|
Value: []byte(strconv.Itoa64(n)),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,18 +20,18 @@ import (
|
||||||
func usage() { fmt.Fprint(os.Stderr, "usage: cgo [compiler options] file.go ...\n") }
|
func usage() { fmt.Fprint(os.Stderr, "usage: cgo [compiler options] file.go ...\n") }
|
||||||
|
|
||||||
var ptrSizeMap = map[string]int64{
|
var ptrSizeMap = map[string]int64{
|
||||||
"386": 4,
|
"386": 4,
|
||||||
"amd64": 8,
|
"amd64": 8,
|
||||||
"arm": 4,
|
"arm": 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
var expandName = map[string]string{
|
var expandName = map[string]string{
|
||||||
"schar": "signed char",
|
"schar": "signed char",
|
||||||
"uchar": "unsigned char",
|
"uchar": "unsigned char",
|
||||||
"ushort": "unsigned short",
|
"ushort": "unsigned short",
|
||||||
"uint": "unsigned int",
|
"uint": "unsigned int",
|
||||||
"ulong": "unsigned long",
|
"ulong": "unsigned long",
|
||||||
"longlong": "long long",
|
"longlong": "long long",
|
||||||
"ulonglong": "unsigned long long",
|
"ulonglong": "unsigned long long",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -689,13 +689,13 @@ func urlFmt(w io.Writer, x interface{}, format string) {
|
||||||
// The strings in infoKinds must be properly html-escaped.
|
// The strings in infoKinds must be properly html-escaped.
|
||||||
var infoKinds = [nKinds]string{
|
var infoKinds = [nKinds]string{
|
||||||
PackageClause: "package clause",
|
PackageClause: "package clause",
|
||||||
ImportDecl: "import decl",
|
ImportDecl: "import decl",
|
||||||
ConstDecl: "const decl",
|
ConstDecl: "const decl",
|
||||||
TypeDecl: "type decl",
|
TypeDecl: "type decl",
|
||||||
VarDecl: "var decl",
|
VarDecl: "var decl",
|
||||||
FuncDecl: "func decl",
|
FuncDecl: "func decl",
|
||||||
MethodDecl: "method decl",
|
MethodDecl: "method decl",
|
||||||
Use: "use",
|
Use: "use",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -762,20 +762,20 @@ func localnameFmt(w io.Writer, x interface{}, format string) {
|
||||||
|
|
||||||
|
|
||||||
var fmap = template.FormatterMap{
|
var fmap = template.FormatterMap{
|
||||||
"": textFmt,
|
"": textFmt,
|
||||||
"html": htmlFmt,
|
"html": htmlFmt,
|
||||||
"html-esc": htmlEscFmt,
|
"html-esc": htmlEscFmt,
|
||||||
"html-comment": htmlCommentFmt,
|
"html-comment": htmlCommentFmt,
|
||||||
"url-pkg": urlFmt,
|
"url-pkg": urlFmt,
|
||||||
"url-src": urlFmt,
|
"url-src": urlFmt,
|
||||||
"url-pos": urlFmt,
|
"url-pos": urlFmt,
|
||||||
"infoKind": infoKindFmt,
|
"infoKind": infoKindFmt,
|
||||||
"infoLine": infoLineFmt,
|
"infoLine": infoLineFmt,
|
||||||
"infoSnippet": infoSnippetFmt,
|
"infoSnippet": infoSnippetFmt,
|
||||||
"padding": paddingFmt,
|
"padding": paddingFmt,
|
||||||
"time": timeFmt,
|
"time": timeFmt,
|
||||||
"dir/": dirslashFmt,
|
"dir/": dirslashFmt,
|
||||||
"localname": localnameFmt,
|
"localname": localnameFmt,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -828,12 +828,12 @@ func servePage(c *http.Conn, title, query string, content []byte) {
|
||||||
|
|
||||||
_, ts := fsTree.get()
|
_, ts := fsTree.get()
|
||||||
d := Data{
|
d := Data{
|
||||||
Title: title,
|
Title: title,
|
||||||
PkgRoots: fsMap.PrefixList(),
|
PkgRoots: fsMap.PrefixList(),
|
||||||
Timestamp: uint64(ts) * 1e9, // timestamp in ns
|
Timestamp: uint64(ts) * 1e9, // timestamp in ns
|
||||||
Query: query,
|
Query: query,
|
||||||
Menu: nil,
|
Menu: nil,
|
||||||
Content: content,
|
Content: content,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := godocHTML.Execute(&d, c); err != nil {
|
if err := godocHTML.Execute(&d, c); err != nil {
|
||||||
|
|
@ -935,7 +935,7 @@ func redirect(c *http.Conn, r *http.Request) (redirected bool) {
|
||||||
// textExt[x] is true if the extension x indicates a text file, and false otherwise.
|
// textExt[x] is true if the extension x indicates a text file, and false otherwise.
|
||||||
var textExt = map[string]bool{
|
var textExt = map[string]bool{
|
||||||
".css": false, // must be served raw
|
".css": false, // must be served raw
|
||||||
".js": false, // must be served raw
|
".js": false, // must be served raw
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -647,7 +647,7 @@ func NewIndex(root string) *Index {
|
||||||
decls := reduce(&h.Decls)
|
decls := reduce(&h.Decls)
|
||||||
others := reduce(&h.Others)
|
others := reduce(&h.Others)
|
||||||
words[w] = &LookupResult{
|
words[w] = &LookupResult{
|
||||||
Decls: decls,
|
Decls: decls,
|
||||||
Others: others,
|
Others: others,
|
||||||
}
|
}
|
||||||
wlist.Push(&wordPair{canonical(w), w})
|
wlist.Push(&wordPair{canonical(w), w})
|
||||||
|
|
|
||||||
|
|
@ -24,26 +24,26 @@ var gnuTarTest = &untarTest{
|
||||||
file: "testdata/gnu.tar",
|
file: "testdata/gnu.tar",
|
||||||
headers: []*Header{
|
headers: []*Header{
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small.txt",
|
Name: "small.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 5,
|
Size: 5,
|
||||||
Mtime: 1244428340,
|
Mtime: 1244428340,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small2.txt",
|
Name: "small2.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 11,
|
Size: 11,
|
||||||
Mtime: 1244436044,
|
Mtime: 1244436044,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
cksums: []string{
|
cksums: []string{
|
||||||
|
|
@ -58,30 +58,30 @@ var untarTests = []*untarTest{
|
||||||
file: "testdata/star.tar",
|
file: "testdata/star.tar",
|
||||||
headers: []*Header{
|
headers: []*Header{
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small.txt",
|
Name: "small.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 5,
|
Size: 5,
|
||||||
Mtime: 1244592783,
|
Mtime: 1244592783,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
Atime: 1244592783,
|
Atime: 1244592783,
|
||||||
Ctime: 1244592783,
|
Ctime: 1244592783,
|
||||||
},
|
},
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small2.txt",
|
Name: "small2.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 11,
|
Size: 11,
|
||||||
Mtime: 1244592783,
|
Mtime: 1244592783,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
Atime: 1244592783,
|
Atime: 1244592783,
|
||||||
Ctime: 1244592783,
|
Ctime: 1244592783,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -89,21 +89,21 @@ var untarTests = []*untarTest{
|
||||||
file: "testdata/v7.tar",
|
file: "testdata/v7.tar",
|
||||||
headers: []*Header{
|
headers: []*Header{
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small.txt",
|
Name: "small.txt",
|
||||||
Mode: 0444,
|
Mode: 0444,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 5,
|
Size: 5,
|
||||||
Mtime: 1244593104,
|
Mtime: 1244593104,
|
||||||
Typeflag: '\x00',
|
Typeflag: '\x00',
|
||||||
},
|
},
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small2.txt",
|
Name: "small2.txt",
|
||||||
Mode: 0444,
|
Mode: 0444,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 11,
|
Size: 11,
|
||||||
Mtime: 1244593104,
|
Mtime: 1244593104,
|
||||||
Typeflag: '\x00',
|
Typeflag: '\x00',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -29,29 +29,29 @@ var writerTests = []*writerTest{
|
||||||
entries: []*writerTestEntry{
|
entries: []*writerTestEntry{
|
||||||
&writerTestEntry{
|
&writerTestEntry{
|
||||||
header: &Header{
|
header: &Header{
|
||||||
Name: "small.txt",
|
Name: "small.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 5,
|
Size: 5,
|
||||||
Mtime: 1246508266,
|
Mtime: 1246508266,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
contents: "Kilts",
|
contents: "Kilts",
|
||||||
},
|
},
|
||||||
&writerTestEntry{
|
&writerTestEntry{
|
||||||
header: &Header{
|
header: &Header{
|
||||||
Name: "small2.txt",
|
Name: "small2.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 11,
|
Size: 11,
|
||||||
Mtime: 1245217492,
|
Mtime: 1245217492,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
contents: "Google.com\n",
|
contents: "Google.com\n",
|
||||||
},
|
},
|
||||||
|
|
@ -65,15 +65,15 @@ var writerTests = []*writerTest{
|
||||||
entries: []*writerTestEntry{
|
entries: []*writerTestEntry{
|
||||||
&writerTestEntry{
|
&writerTestEntry{
|
||||||
header: &Header{
|
header: &Header{
|
||||||
Name: "tmp/16gig.txt",
|
Name: "tmp/16gig.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 16 << 30,
|
Size: 16 << 30,
|
||||||
Mtime: 1254699560,
|
Mtime: 1254699560,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
// no contents
|
// no contents
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -470,9 +470,9 @@ func marshalField(out *forkableWriter, v reflect.Value, params fieldParameters)
|
||||||
|
|
||||||
if params.explicit {
|
if params.explicit {
|
||||||
err = marshalTagAndLength(explicitTag, tagAndLength{
|
err = marshalTagAndLength(explicitTag, tagAndLength{
|
||||||
class: classContextSpecific,
|
class: classContextSpecific,
|
||||||
tag: *params.tag,
|
tag: *params.tag,
|
||||||
length: bodyLen + tags.Len(),
|
length: bodyLen + tags.Len(),
|
||||||
isCompound: true,
|
isCompound: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -94,9 +94,9 @@ func TestProdZZ(t *testing.T) {
|
||||||
|
|
||||||
|
|
||||||
var facts = map[int]string{
|
var facts = map[int]string{
|
||||||
0: "1",
|
0: "1",
|
||||||
1: "1",
|
1: "1",
|
||||||
2: "2",
|
2: "2",
|
||||||
10: "3628800",
|
10: "3628800",
|
||||||
20: "2432902008176640000",
|
20: "2432902008176640000",
|
||||||
100: "933262154439441526816992388562667004907159682643816214685929" +
|
100: "933262154439441526816992388562667004907159682643816214685929" +
|
||||||
|
|
|
||||||
|
|
@ -98,13 +98,13 @@ type WrongValueError struct {
|
||||||
|
|
||||||
func newHuffmanBitWriter(w io.Writer) *huffmanBitWriter {
|
func newHuffmanBitWriter(w io.Writer) *huffmanBitWriter {
|
||||||
return &huffmanBitWriter{
|
return &huffmanBitWriter{
|
||||||
w: w,
|
w: w,
|
||||||
literalFreq: make([]int32, maxLit),
|
literalFreq: make([]int32, maxLit),
|
||||||
offsetFreq: make([]int32, extendedOffsetCodeCount),
|
offsetFreq: make([]int32, extendedOffsetCodeCount),
|
||||||
codegen: make([]uint8, maxLit+extendedOffsetCodeCount+1),
|
codegen: make([]uint8, maxLit+extendedOffsetCodeCount+1),
|
||||||
codegenFreq: make([]int32, codegenCodeCount),
|
codegenFreq: make([]int32, codegenCodeCount),
|
||||||
literalEncoding: newHuffmanEncoder(maxLit),
|
literalEncoding: newHuffmanEncoder(maxLit),
|
||||||
offsetEncoding: newHuffmanEncoder(extendedOffsetCodeCount),
|
offsetEncoding: newHuffmanEncoder(extendedOffsetCodeCount),
|
||||||
codegenEncoding: newHuffmanEncoder(codegenCodeCount),
|
codegenEncoding: newHuffmanEncoder(codegenCodeCount),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -207,11 +207,11 @@ func (h *huffmanEncoder) bitCounts(list []literalNode, maxBits int32) []int32 {
|
||||||
// For every level, the first two items are the first two characters.
|
// For every level, the first two items are the first two characters.
|
||||||
// We initialize the levels as if we had already figured this out.
|
// We initialize the levels as if we had already figured this out.
|
||||||
top = &levelInfo{
|
top = &levelInfo{
|
||||||
level: level,
|
level: level,
|
||||||
lastChain: chain2,
|
lastChain: chain2,
|
||||||
nextCharFreq: list[2].freq,
|
nextCharFreq: list[2].freq,
|
||||||
nextPairFreq: list[0].freq + list[1].freq,
|
nextPairFreq: list[0].freq + list[1].freq,
|
||||||
down: top,
|
down: top,
|
||||||
}
|
}
|
||||||
top.down.up = top
|
top.down.up = top
|
||||||
if level == 1 {
|
if level == 1 {
|
||||||
|
|
|
||||||
|
|
@ -34,11 +34,11 @@ func (h *clientHandshake) loop(writeChan chan<- interface{}, controlChan chan<-
|
||||||
finishedHash := newFinishedHash()
|
finishedHash := newFinishedHash()
|
||||||
|
|
||||||
hello := &clientHelloMsg{
|
hello := &clientHelloMsg{
|
||||||
major: defaultMajor,
|
major: defaultMajor,
|
||||||
minor: defaultMinor,
|
minor: defaultMinor,
|
||||||
cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
|
cipherSuites: []uint16{TLS_RSA_WITH_RC4_128_SHA},
|
||||||
compressionMethods: []uint8{compressionNone},
|
compressionMethods: []uint8{compressionNone},
|
||||||
random: make([]byte, 32),
|
random: make([]byte, 32),
|
||||||
}
|
}
|
||||||
|
|
||||||
currentTime := uint32(config.Time())
|
currentTime := uint32(config.Time())
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,11 @@ func ParsePKCS1PrivateKey(der []byte) (key *rsa.PrivateKey, err os.Error) {
|
||||||
func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte {
|
func MarshalPKCS1PrivateKey(key *rsa.PrivateKey) []byte {
|
||||||
priv := pkcs1PrivateKey{
|
priv := pkcs1PrivateKey{
|
||||||
Version: 1,
|
Version: 1,
|
||||||
N: asn1.RawValue{Tag: 2, Bytes: key.PublicKey.N.Bytes()},
|
N: asn1.RawValue{Tag: 2, Bytes: key.PublicKey.N.Bytes()},
|
||||||
E: key.PublicKey.E,
|
E: key.PublicKey.E,
|
||||||
D: asn1.RawValue{Tag: 2, Bytes: key.D.Bytes()},
|
D: asn1.RawValue{Tag: 2, Bytes: key.D.Bytes()},
|
||||||
P: asn1.RawValue{Tag: 2, Bytes: key.P.Bytes()},
|
P: asn1.RawValue{Tag: 2, Bytes: key.P.Bytes()},
|
||||||
Q: asn1.RawValue{Tag: 2, Bytes: key.Q.Bytes()},
|
Q: asn1.RawValue{Tag: 2, Bytes: key.Q.Bytes()},
|
||||||
}
|
}
|
||||||
|
|
||||||
b, _ := asn1.MarshalToMemory(priv)
|
b, _ := asn1.MarshalToMemory(priv)
|
||||||
|
|
@ -787,9 +787,9 @@ func CreateCertificate(rand io.Reader, template, parent *Certificate, priv *rsa.
|
||||||
Version: 3,
|
Version: 3,
|
||||||
SerialNumber: asn1.RawValue{Bytes: template.SerialNumber, Tag: 2},
|
SerialNumber: asn1.RawValue{Bytes: template.SerialNumber, Tag: 2},
|
||||||
SignatureAlgorithm: algorithmIdentifier{oidSHA1WithRSA},
|
SignatureAlgorithm: algorithmIdentifier{oidSHA1WithRSA},
|
||||||
Issuer: parent.Subject.toRDNSequence(),
|
Issuer: parent.Subject.toRDNSequence(),
|
||||||
Validity: validity{template.NotBefore, template.NotAfter},
|
Validity: validity{template.NotBefore, template.NotAfter},
|
||||||
Subject: template.Subject.toRDNSequence(),
|
Subject: template.Subject.toRDNSequence(),
|
||||||
PublicKey: publicKeyInfo{algorithmIdentifier{oidRSA}, encodedPublicKey},
|
PublicKey: publicKeyInfo{algorithmIdentifier{oidRSA}, encodedPublicKey},
|
||||||
Extensions: extensions,
|
Extensions: extensions,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -160,18 +160,18 @@ func TestCreateSelfSignedCertificate(t *testing.T) {
|
||||||
template := Certificate{
|
template := Certificate{
|
||||||
SerialNumber: []byte{1},
|
SerialNumber: []byte{1},
|
||||||
Subject: Name{
|
Subject: Name{
|
||||||
CommonName: "test.example.com",
|
CommonName: "test.example.com",
|
||||||
Organization: "Acme Co",
|
Organization: "Acme Co",
|
||||||
},
|
},
|
||||||
NotBefore: time.SecondsToUTC(1000),
|
NotBefore: time.SecondsToUTC(1000),
|
||||||
NotAfter: time.SecondsToUTC(100000),
|
NotAfter: time.SecondsToUTC(100000),
|
||||||
|
|
||||||
SubjectKeyId: []byte{1, 2, 3, 4},
|
SubjectKeyId: []byte{1, 2, 3, 4},
|
||||||
KeyUsage: KeyUsageCertSign,
|
KeyUsage: KeyUsageCertSign,
|
||||||
|
|
||||||
BasicConstraintsValid: true,
|
BasicConstraintsValid: true,
|
||||||
IsCA: true,
|
IsCA: true,
|
||||||
DNSNames: []string{"test.example.com"},
|
DNSNames: []string{"test.example.com"},
|
||||||
}
|
}
|
||||||
|
|
||||||
derBytes, err := CreateCertificate(urandom, &template, &template, priv)
|
derBytes, err := CreateCertificate(urandom, &template, &template, priv)
|
||||||
|
|
|
||||||
|
|
@ -87,78 +87,78 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var attrNames = [...]string{
|
var attrNames = [...]string{
|
||||||
AttrSibling: "Sibling",
|
AttrSibling: "Sibling",
|
||||||
AttrLocation: "Location",
|
AttrLocation: "Location",
|
||||||
AttrName: "Name",
|
AttrName: "Name",
|
||||||
AttrOrdering: "Ordering",
|
AttrOrdering: "Ordering",
|
||||||
AttrByteSize: "ByteSize",
|
AttrByteSize: "ByteSize",
|
||||||
AttrBitOffset: "BitOffset",
|
AttrBitOffset: "BitOffset",
|
||||||
AttrBitSize: "BitSize",
|
AttrBitSize: "BitSize",
|
||||||
AttrStmtList: "StmtList",
|
AttrStmtList: "StmtList",
|
||||||
AttrLowpc: "Lowpc",
|
AttrLowpc: "Lowpc",
|
||||||
AttrHighpc: "Highpc",
|
AttrHighpc: "Highpc",
|
||||||
AttrLanguage: "Language",
|
AttrLanguage: "Language",
|
||||||
AttrDiscr: "Discr",
|
AttrDiscr: "Discr",
|
||||||
AttrDiscrValue: "DiscrValue",
|
AttrDiscrValue: "DiscrValue",
|
||||||
AttrVisibility: "Visibility",
|
AttrVisibility: "Visibility",
|
||||||
AttrImport: "Import",
|
AttrImport: "Import",
|
||||||
AttrStringLength: "StringLength",
|
AttrStringLength: "StringLength",
|
||||||
AttrCommonRef: "CommonRef",
|
AttrCommonRef: "CommonRef",
|
||||||
AttrCompDir: "CompDir",
|
AttrCompDir: "CompDir",
|
||||||
AttrConstValue: "ConstValue",
|
AttrConstValue: "ConstValue",
|
||||||
AttrContainingType: "ContainingType",
|
AttrContainingType: "ContainingType",
|
||||||
AttrDefaultValue: "DefaultValue",
|
AttrDefaultValue: "DefaultValue",
|
||||||
AttrInline: "Inline",
|
AttrInline: "Inline",
|
||||||
AttrIsOptional: "IsOptional",
|
AttrIsOptional: "IsOptional",
|
||||||
AttrLowerBound: "LowerBound",
|
AttrLowerBound: "LowerBound",
|
||||||
AttrProducer: "Producer",
|
AttrProducer: "Producer",
|
||||||
AttrPrototyped: "Prototyped",
|
AttrPrototyped: "Prototyped",
|
||||||
AttrReturnAddr: "ReturnAddr",
|
AttrReturnAddr: "ReturnAddr",
|
||||||
AttrStartScope: "StartScope",
|
AttrStartScope: "StartScope",
|
||||||
AttrStrideSize: "StrideSize",
|
AttrStrideSize: "StrideSize",
|
||||||
AttrUpperBound: "UpperBound",
|
AttrUpperBound: "UpperBound",
|
||||||
AttrAbstractOrigin: "AbstractOrigin",
|
AttrAbstractOrigin: "AbstractOrigin",
|
||||||
AttrAccessibility: "Accessibility",
|
AttrAccessibility: "Accessibility",
|
||||||
AttrAddrClass: "AddrClass",
|
AttrAddrClass: "AddrClass",
|
||||||
AttrArtificial: "Artificial",
|
AttrArtificial: "Artificial",
|
||||||
AttrBaseTypes: "BaseTypes",
|
AttrBaseTypes: "BaseTypes",
|
||||||
AttrCalling: "Calling",
|
AttrCalling: "Calling",
|
||||||
AttrCount: "Count",
|
AttrCount: "Count",
|
||||||
AttrDataMemberLoc: "DataMemberLoc",
|
AttrDataMemberLoc: "DataMemberLoc",
|
||||||
AttrDeclColumn: "DeclColumn",
|
AttrDeclColumn: "DeclColumn",
|
||||||
AttrDeclFile: "DeclFile",
|
AttrDeclFile: "DeclFile",
|
||||||
AttrDeclLine: "DeclLine",
|
AttrDeclLine: "DeclLine",
|
||||||
AttrDeclaration: "Declaration",
|
AttrDeclaration: "Declaration",
|
||||||
AttrDiscrList: "DiscrList",
|
AttrDiscrList: "DiscrList",
|
||||||
AttrEncoding: "Encoding",
|
AttrEncoding: "Encoding",
|
||||||
AttrExternal: "External",
|
AttrExternal: "External",
|
||||||
AttrFrameBase: "FrameBase",
|
AttrFrameBase: "FrameBase",
|
||||||
AttrFriend: "Friend",
|
AttrFriend: "Friend",
|
||||||
AttrIdentifierCase: "IdentifierCase",
|
AttrIdentifierCase: "IdentifierCase",
|
||||||
AttrMacroInfo: "MacroInfo",
|
AttrMacroInfo: "MacroInfo",
|
||||||
AttrNamelistItem: "NamelistItem",
|
AttrNamelistItem: "NamelistItem",
|
||||||
AttrPriority: "Priority",
|
AttrPriority: "Priority",
|
||||||
AttrSegment: "Segment",
|
AttrSegment: "Segment",
|
||||||
AttrSpecification: "Specification",
|
AttrSpecification: "Specification",
|
||||||
AttrStaticLink: "StaticLink",
|
AttrStaticLink: "StaticLink",
|
||||||
AttrType: "Type",
|
AttrType: "Type",
|
||||||
AttrUseLocation: "UseLocation",
|
AttrUseLocation: "UseLocation",
|
||||||
AttrVarParam: "VarParam",
|
AttrVarParam: "VarParam",
|
||||||
AttrVirtuality: "Virtuality",
|
AttrVirtuality: "Virtuality",
|
||||||
AttrVtableElemLoc: "VtableElemLoc",
|
AttrVtableElemLoc: "VtableElemLoc",
|
||||||
AttrAllocated: "Allocated",
|
AttrAllocated: "Allocated",
|
||||||
AttrAssociated: "Associated",
|
AttrAssociated: "Associated",
|
||||||
AttrDataLocation: "DataLocation",
|
AttrDataLocation: "DataLocation",
|
||||||
AttrStride: "Stride",
|
AttrStride: "Stride",
|
||||||
AttrEntrypc: "Entrypc",
|
AttrEntrypc: "Entrypc",
|
||||||
AttrUseUTF8: "UseUTF8",
|
AttrUseUTF8: "UseUTF8",
|
||||||
AttrExtension: "Extension",
|
AttrExtension: "Extension",
|
||||||
AttrRanges: "Ranges",
|
AttrRanges: "Ranges",
|
||||||
AttrTrampoline: "Trampoline",
|
AttrTrampoline: "Trampoline",
|
||||||
AttrCallColumn: "CallColumn",
|
AttrCallColumn: "CallColumn",
|
||||||
AttrCallFile: "CallFile",
|
AttrCallFile: "CallFile",
|
||||||
AttrCallLine: "CallLine",
|
AttrCallLine: "CallLine",
|
||||||
AttrDescription: "Description",
|
AttrDescription: "Description",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a Attr) String() string {
|
func (a Attr) String() string {
|
||||||
|
|
@ -272,62 +272,62 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var tagNames = [...]string{
|
var tagNames = [...]string{
|
||||||
TagArrayType: "ArrayType",
|
TagArrayType: "ArrayType",
|
||||||
TagClassType: "ClassType",
|
TagClassType: "ClassType",
|
||||||
TagEntryPoint: "EntryPoint",
|
TagEntryPoint: "EntryPoint",
|
||||||
TagEnumerationType: "EnumerationType",
|
TagEnumerationType: "EnumerationType",
|
||||||
TagFormalParameter: "FormalParameter",
|
TagFormalParameter: "FormalParameter",
|
||||||
TagImportedDeclaration: "ImportedDeclaration",
|
TagImportedDeclaration: "ImportedDeclaration",
|
||||||
TagLabel: "Label",
|
TagLabel: "Label",
|
||||||
TagLexDwarfBlock: "LexDwarfBlock",
|
TagLexDwarfBlock: "LexDwarfBlock",
|
||||||
TagMember: "Member",
|
TagMember: "Member",
|
||||||
TagPointerType: "PointerType",
|
TagPointerType: "PointerType",
|
||||||
TagReferenceType: "ReferenceType",
|
TagReferenceType: "ReferenceType",
|
||||||
TagCompileUnit: "CompileUnit",
|
TagCompileUnit: "CompileUnit",
|
||||||
TagStringType: "StringType",
|
TagStringType: "StringType",
|
||||||
TagStructType: "StructType",
|
TagStructType: "StructType",
|
||||||
TagSubroutineType: "SubroutineType",
|
TagSubroutineType: "SubroutineType",
|
||||||
TagTypedef: "Typedef",
|
TagTypedef: "Typedef",
|
||||||
TagUnionType: "UnionType",
|
TagUnionType: "UnionType",
|
||||||
TagUnspecifiedParameters: "UnspecifiedParameters",
|
TagUnspecifiedParameters: "UnspecifiedParameters",
|
||||||
TagVariant: "Variant",
|
TagVariant: "Variant",
|
||||||
TagCommonDwarfBlock: "CommonDwarfBlock",
|
TagCommonDwarfBlock: "CommonDwarfBlock",
|
||||||
TagCommonInclusion: "CommonInclusion",
|
TagCommonInclusion: "CommonInclusion",
|
||||||
TagInheritance: "Inheritance",
|
TagInheritance: "Inheritance",
|
||||||
TagInlinedSubroutine: "InlinedSubroutine",
|
TagInlinedSubroutine: "InlinedSubroutine",
|
||||||
TagModule: "Module",
|
TagModule: "Module",
|
||||||
TagPtrToMemberType: "PtrToMemberType",
|
TagPtrToMemberType: "PtrToMemberType",
|
||||||
TagSetType: "SetType",
|
TagSetType: "SetType",
|
||||||
TagSubrangeType: "SubrangeType",
|
TagSubrangeType: "SubrangeType",
|
||||||
TagWithStmt: "WithStmt",
|
TagWithStmt: "WithStmt",
|
||||||
TagAccessDeclaration: "AccessDeclaration",
|
TagAccessDeclaration: "AccessDeclaration",
|
||||||
TagBaseType: "BaseType",
|
TagBaseType: "BaseType",
|
||||||
TagCatchDwarfBlock: "CatchDwarfBlock",
|
TagCatchDwarfBlock: "CatchDwarfBlock",
|
||||||
TagConstType: "ConstType",
|
TagConstType: "ConstType",
|
||||||
TagConstant: "Constant",
|
TagConstant: "Constant",
|
||||||
TagEnumerator: "Enumerator",
|
TagEnumerator: "Enumerator",
|
||||||
TagFileType: "FileType",
|
TagFileType: "FileType",
|
||||||
TagFriend: "Friend",
|
TagFriend: "Friend",
|
||||||
TagNamelist: "Namelist",
|
TagNamelist: "Namelist",
|
||||||
TagNamelistItem: "NamelistItem",
|
TagNamelistItem: "NamelistItem",
|
||||||
TagPackedType: "PackedType",
|
TagPackedType: "PackedType",
|
||||||
TagSubprogram: "Subprogram",
|
TagSubprogram: "Subprogram",
|
||||||
TagTemplateTypeParameter: "TemplateTypeParameter",
|
TagTemplateTypeParameter: "TemplateTypeParameter",
|
||||||
TagTemplateValueParameter: "TemplateValueParameter",
|
TagTemplateValueParameter: "TemplateValueParameter",
|
||||||
TagThrownType: "ThrownType",
|
TagThrownType: "ThrownType",
|
||||||
TagTryDwarfBlock: "TryDwarfBlock",
|
TagTryDwarfBlock: "TryDwarfBlock",
|
||||||
TagVariantPart: "VariantPart",
|
TagVariantPart: "VariantPart",
|
||||||
TagVariable: "Variable",
|
TagVariable: "Variable",
|
||||||
TagVolatileType: "VolatileType",
|
TagVolatileType: "VolatileType",
|
||||||
TagDwarfProcedure: "DwarfProcedure",
|
TagDwarfProcedure: "DwarfProcedure",
|
||||||
TagRestrictType: "RestrictType",
|
TagRestrictType: "RestrictType",
|
||||||
TagInterfaceType: "InterfaceType",
|
TagInterfaceType: "InterfaceType",
|
||||||
TagNamespace: "Namespace",
|
TagNamespace: "Namespace",
|
||||||
TagImportedModule: "ImportedModule",
|
TagImportedModule: "ImportedModule",
|
||||||
TagUnspecifiedType: "UnspecifiedType",
|
TagUnspecifiedType: "UnspecifiedType",
|
||||||
TagPartialUnit: "PartialUnit",
|
TagPartialUnit: "PartialUnit",
|
||||||
TagImportedUnit: "ImportedUnit",
|
TagImportedUnit: "ImportedUnit",
|
||||||
TagMutableType: "MutableType",
|
TagMutableType: "MutableType",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t Tag) String() string {
|
func (t Tag) String() string {
|
||||||
|
|
|
||||||
|
|
@ -138,10 +138,10 @@ func (b *buf) entry(atab abbrevTable, ubase Offset) *Entry {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
e := &Entry{
|
e := &Entry{
|
||||||
Offset: off,
|
Offset: off,
|
||||||
Tag: a.tag,
|
Tag: a.tag,
|
||||||
Children: a.children,
|
Children: a.children,
|
||||||
Field: make([]Field, len(a.field)),
|
Field: make([]Field, len(a.field)),
|
||||||
}
|
}
|
||||||
for i := range e.Field {
|
for i := range e.Field {
|
||||||
e.Field[i].Attr = a.field[i].attr
|
e.Field[i].Attr = a.field[i].attr
|
||||||
|
|
|
||||||
|
|
@ -42,16 +42,16 @@ type Data struct {
|
||||||
// the ".debug_abbrev" section.
|
// the ".debug_abbrev" section.
|
||||||
func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, os.Error) {
|
func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, os.Error) {
|
||||||
d := &Data{
|
d := &Data{
|
||||||
abbrev: abbrev,
|
abbrev: abbrev,
|
||||||
aranges: aranges,
|
aranges: aranges,
|
||||||
frame: frame,
|
frame: frame,
|
||||||
info: info,
|
info: info,
|
||||||
line: line,
|
line: line,
|
||||||
pubnames: pubnames,
|
pubnames: pubnames,
|
||||||
ranges: ranges,
|
ranges: ranges,
|
||||||
str: str,
|
str: str,
|
||||||
abbrevCache: make(map[uint32]abbrevTable),
|
abbrevCache: make(map[uint32]abbrevTable),
|
||||||
typeCache: make(map[Offset]Type),
|
typeCache: make(map[Offset]Type),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sniff .debug_info to figure out byte order.
|
// Sniff .debug_info to figure out byte order.
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,15 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var typedefTests = map[string]string{
|
var typedefTests = map[string]string{
|
||||||
"t_ptr_volatile_int": "*volatile int",
|
"t_ptr_volatile_int": "*volatile int",
|
||||||
"t_ptr_const_char": "*const char",
|
"t_ptr_const_char": "*const char",
|
||||||
"t_long": "long int",
|
"t_long": "long int",
|
||||||
"t_ushort": "short unsigned int",
|
"t_ushort": "short unsigned int",
|
||||||
"t_func_int_of_float_double": "func(float, double) int",
|
"t_func_int_of_float_double": "func(float, double) int",
|
||||||
"t_ptr_func_int_of_float_double": "*func(float, double) int",
|
"t_ptr_func_int_of_float_double": "*func(float, double) int",
|
||||||
"t_func_ptr_int_of_char_schar_uchar": "func(char, signed char, unsigned char) *int",
|
"t_func_ptr_int_of_char_schar_uchar": "func(char, signed char, unsigned char) *int",
|
||||||
"t_func_void_of_char": "func(char) void",
|
"t_func_void_of_char": "func(char) void",
|
||||||
"t_func_void_of_void": "func() void",
|
"t_func_void_of_void": "func() void",
|
||||||
"t_func_void_of_ptr_char_dots": "func(*char, ...) void",
|
"t_func_void_of_ptr_char_dots": "func(*char, ...) void",
|
||||||
"t_my_struct": "struct my_struct {vi volatile int@0; x char@4 : 1@7; y int@4 : 4@27; array [40]long long int@8}",
|
"t_my_struct": "struct my_struct {vi volatile int@0; x char@4 : 1@7; y int@4 : 4@27; array [40]long long int@8}",
|
||||||
"t_my_union": "union my_union {vi volatile int@0; x char@0 : 1@7; y int@0 : 4@28; array [40]long long int@0}",
|
"t_my_union": "union my_union {vi volatile int@0; x char@0 : 1@7; y int@0 : 4@28; array [40]long long int@0}",
|
||||||
|
|
|
||||||
|
|
@ -259,15 +259,15 @@ func NewFile(r io.ReaderAt) (*File, os.Error) {
|
||||||
}
|
}
|
||||||
names[i] = sh.Name
|
names[i] = sh.Name
|
||||||
s.SectionHeader = SectionHeader{
|
s.SectionHeader = SectionHeader{
|
||||||
Type: SectionType(sh.Type),
|
Type: SectionType(sh.Type),
|
||||||
Flags: SectionFlag(sh.Flags),
|
Flags: SectionFlag(sh.Flags),
|
||||||
Addr: uint64(sh.Addr),
|
Addr: uint64(sh.Addr),
|
||||||
Offset: uint64(sh.Off),
|
Offset: uint64(sh.Off),
|
||||||
Size: uint64(sh.Size),
|
Size: uint64(sh.Size),
|
||||||
Link: uint32(sh.Link),
|
Link: uint32(sh.Link),
|
||||||
Info: uint32(sh.Info),
|
Info: uint32(sh.Info),
|
||||||
Addralign: uint64(sh.Addralign),
|
Addralign: uint64(sh.Addralign),
|
||||||
Entsize: uint64(sh.Entsize),
|
Entsize: uint64(sh.Entsize),
|
||||||
}
|
}
|
||||||
case ELFCLASS64:
|
case ELFCLASS64:
|
||||||
sh := new(Section64)
|
sh := new(Section64)
|
||||||
|
|
@ -276,15 +276,15 @@ func NewFile(r io.ReaderAt) (*File, os.Error) {
|
||||||
}
|
}
|
||||||
names[i] = sh.Name
|
names[i] = sh.Name
|
||||||
s.SectionHeader = SectionHeader{
|
s.SectionHeader = SectionHeader{
|
||||||
Type: SectionType(sh.Type),
|
Type: SectionType(sh.Type),
|
||||||
Flags: SectionFlag(sh.Flags),
|
Flags: SectionFlag(sh.Flags),
|
||||||
Offset: uint64(sh.Off),
|
Offset: uint64(sh.Off),
|
||||||
Size: uint64(sh.Size),
|
Size: uint64(sh.Size),
|
||||||
Addr: uint64(sh.Addr),
|
Addr: uint64(sh.Addr),
|
||||||
Link: uint32(sh.Link),
|
Link: uint32(sh.Link),
|
||||||
Info: uint32(sh.Info),
|
Info: uint32(sh.Info),
|
||||||
Addralign: uint64(sh.Addralign),
|
Addralign: uint64(sh.Addralign),
|
||||||
Entsize: uint64(sh.Entsize),
|
Entsize: uint64(sh.Entsize),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
s.sr = io.NewSectionReader(r, int64(s.Offset), int64(s.Size))
|
s.sr = io.NewSectionReader(r, int64(s.Offset), int64(s.Size))
|
||||||
|
|
|
||||||
|
|
@ -1249,13 +1249,13 @@ func (p *process) attachAllThreads() os.Error {
|
||||||
// newProcess creates a new process object and starts its monitor thread.
|
// newProcess creates a new process object and starts its monitor thread.
|
||||||
func newProcess(pid int) *process {
|
func newProcess(pid int) *process {
|
||||||
p := &process{
|
p := &process{
|
||||||
pid: pid,
|
pid: pid,
|
||||||
threads: make(map[int]*thread),
|
threads: make(map[int]*thread),
|
||||||
breakpoints: make(map[uintptr]*breakpoint),
|
breakpoints: make(map[uintptr]*breakpoint),
|
||||||
ready: make(chan bool, 1),
|
ready: make(chan bool, 1),
|
||||||
debugEvents: make(chan *debugEvent),
|
debugEvents: make(chan *debugEvent),
|
||||||
debugReqs: make(chan *debugReq),
|
debugReqs: make(chan *debugReq),
|
||||||
stopReq: make(chan os.Error),
|
stopReq: make(chan os.Error),
|
||||||
transitionHandlers: new(vector.Vector),
|
transitionHandlers: new(vector.Vector),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ func Decode(data []byte) (p *Block, rest []byte) {
|
||||||
|
|
||||||
p = &Block{
|
p = &Block{
|
||||||
Headers: make(map[string]string),
|
Headers: make(map[string]string),
|
||||||
Type: string(typeLine),
|
Type: string(typeLine),
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,9 @@ func newUniverse() *Scope {
|
||||||
sc := &Scope{nil, 0}
|
sc := &Scope{nil, 0}
|
||||||
sc.block = &block{
|
sc.block = &block{
|
||||||
offset: 0,
|
offset: 0,
|
||||||
scope: sc,
|
scope: sc,
|
||||||
global: true,
|
global: true,
|
||||||
defs: make(map[string]Def),
|
defs: make(map[string]Def),
|
||||||
}
|
}
|
||||||
return sc
|
return sc
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -249,10 +249,10 @@ type assignCompiler struct {
|
||||||
// fail and these expressions given a nil type.
|
// fail and these expressions given a nil type.
|
||||||
func (a *compiler) checkAssign(pos token.Position, rs []*expr, errOp, errPosName string) (*assignCompiler, bool) {
|
func (a *compiler) checkAssign(pos token.Position, rs []*expr, errOp, errPosName string) (*assignCompiler, bool) {
|
||||||
c := &assignCompiler{
|
c := &assignCompiler{
|
||||||
compiler: a,
|
compiler: a,
|
||||||
pos: pos,
|
pos: pos,
|
||||||
rs: rs,
|
rs: rs,
|
||||||
errOp: errOp,
|
errOp: errOp,
|
||||||
errPosName: errPosName,
|
errPosName: errPosName,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,14 +103,14 @@ var binOps = []Op{
|
||||||
Op{Name: "Sub", Expr: "l - r", ConstExpr: "l.Sub(r)", Types: numbers},
|
Op{Name: "Sub", Expr: "l - r", ConstExpr: "l.Sub(r)", Types: numbers},
|
||||||
Op{Name: "Mul", Expr: "l * r", ConstExpr: "l.Mul(r)", Types: numbers},
|
Op{Name: "Mul", Expr: "l * r", ConstExpr: "l.Mul(r)", Types: numbers},
|
||||||
Op{Name: "Quo",
|
Op{Name: "Quo",
|
||||||
Body: "if r == 0 { t.Abort(DivByZeroError{}) } ret = l / r",
|
Body: "if r == 0 { t.Abort(DivByZeroError{}) } ret = l / r",
|
||||||
ConstExpr: "l.Quo(r)",
|
ConstExpr: "l.Quo(r)",
|
||||||
Types: numbers,
|
Types: numbers,
|
||||||
},
|
},
|
||||||
Op{Name: "Rem",
|
Op{Name: "Rem",
|
||||||
Body: "if r == 0 { t.Abort(DivByZeroError{}) } ret = l % r",
|
Body: "if r == 0 { t.Abort(DivByZeroError{}) } ret = l % r",
|
||||||
ConstExpr: "l.Rem(r)",
|
ConstExpr: "l.Rem(r)",
|
||||||
Types: integers,
|
Types: integers,
|
||||||
},
|
},
|
||||||
Op{Name: "And", Expr: "l & r", ConstExpr: "l.And(r)", Types: integers},
|
Op{Name: "And", Expr: "l & r", ConstExpr: "l.And(r)", Types: integers},
|
||||||
Op{Name: "Or", Expr: "l | r", ConstExpr: "l.Or(r)", Types: integers},
|
Op{Name: "Or", Expr: "l | r", ConstExpr: "l.Or(r)", Types: integers},
|
||||||
|
|
|
||||||
|
|
@ -77,9 +77,9 @@ func (b *block) enterChild() *block {
|
||||||
log.Crash("Failed to exit child block before entering another child")
|
log.Crash("Failed to exit child block before entering another child")
|
||||||
}
|
}
|
||||||
sub := &block{
|
sub := &block{
|
||||||
outer: b,
|
outer: b,
|
||||||
scope: b.scope,
|
scope: b.scope,
|
||||||
defs: make(map[string]Def),
|
defs: make(map[string]Def),
|
||||||
offset: b.offset + b.numVars,
|
offset: b.offset + b.numVars,
|
||||||
}
|
}
|
||||||
b.inner = sub
|
b.inner = sub
|
||||||
|
|
|
||||||
|
|
@ -742,11 +742,11 @@ var assignOpToOp = map[token.Token]token.Token{
|
||||||
token.QUO_ASSIGN: token.QUO,
|
token.QUO_ASSIGN: token.QUO,
|
||||||
token.REM_ASSIGN: token.REM,
|
token.REM_ASSIGN: token.REM,
|
||||||
|
|
||||||
token.AND_ASSIGN: token.AND,
|
token.AND_ASSIGN: token.AND,
|
||||||
token.OR_ASSIGN: token.OR,
|
token.OR_ASSIGN: token.OR,
|
||||||
token.XOR_ASSIGN: token.XOR,
|
token.XOR_ASSIGN: token.XOR,
|
||||||
token.SHL_ASSIGN: token.SHL,
|
token.SHL_ASSIGN: token.SHL,
|
||||||
token.SHR_ASSIGN: token.SHR,
|
token.SHR_ASSIGN: token.SHR,
|
||||||
token.AND_NOT_ASSIGN: token.AND_NOT,
|
token.AND_NOT_ASSIGN: token.AND_NOT,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1215,8 +1215,8 @@ func (a *blockCompiler) enterChild() *blockCompiler {
|
||||||
block := a.block.enterChild()
|
block := a.block.enterChild()
|
||||||
return &blockCompiler{
|
return &blockCompiler{
|
||||||
funcCompiler: a.funcCompiler,
|
funcCompiler: a.funcCompiler,
|
||||||
block: block,
|
block: block,
|
||||||
parent: a,
|
parent: a,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1252,15 +1252,15 @@ func (a *compiler) compileFunc(b *block, decl *FuncDecl, body *ast.BlockStmt) fu
|
||||||
cb := newCodeBuf()
|
cb := newCodeBuf()
|
||||||
fc := &funcCompiler{
|
fc := &funcCompiler{
|
||||||
compiler: a,
|
compiler: a,
|
||||||
fnType: decl.Type,
|
fnType: decl.Type,
|
||||||
outVarsNamed: len(decl.OutNames) > 0 && decl.OutNames[0] != nil,
|
outVarsNamed: len(decl.OutNames) > 0 && decl.OutNames[0] != nil,
|
||||||
codeBuf: cb,
|
codeBuf: cb,
|
||||||
flow: newFlowBuf(cb),
|
flow: newFlowBuf(cb),
|
||||||
labels: make(map[string]*label),
|
labels: make(map[string]*label),
|
||||||
}
|
}
|
||||||
bc := &blockCompiler{
|
bc := &blockCompiler{
|
||||||
funcCompiler: fc,
|
funcCompiler: fc,
|
||||||
block: bodyScope.block,
|
block: bodyScope.block,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compile body
|
// Compile body
|
||||||
|
|
|
||||||
|
|
@ -51,16 +51,16 @@ func (w *World) CompileStmtList(stmts []ast.Stmt) (Code, os.Error) {
|
||||||
cc := &compiler{errors, 0, 0}
|
cc := &compiler{errors, 0, 0}
|
||||||
cb := newCodeBuf()
|
cb := newCodeBuf()
|
||||||
fc := &funcCompiler{
|
fc := &funcCompiler{
|
||||||
compiler: cc,
|
compiler: cc,
|
||||||
fnType: nil,
|
fnType: nil,
|
||||||
outVarsNamed: false,
|
outVarsNamed: false,
|
||||||
codeBuf: cb,
|
codeBuf: cb,
|
||||||
flow: newFlowBuf(cb),
|
flow: newFlowBuf(cb),
|
||||||
labels: make(map[string]*label),
|
labels: make(map[string]*label),
|
||||||
}
|
}
|
||||||
bc := &blockCompiler{
|
bc := &blockCompiler{
|
||||||
funcCompiler: fc,
|
funcCompiler: fc,
|
||||||
block: w.scope.block,
|
block: w.scope.block,
|
||||||
}
|
}
|
||||||
nerr := cc.numError()
|
nerr := cc.numError()
|
||||||
for _, stmt := range stmts {
|
for _, stmt := range stmts {
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,9 @@ func NewClient(fd int) (c *Client, err os.Error) {
|
||||||
// service discovery request
|
// service discovery request
|
||||||
m := &msg{
|
m := &msg{
|
||||||
protocol: protocol,
|
protocol: protocol,
|
||||||
isReq: true,
|
isReq: true,
|
||||||
Ret: []interface{}{[]byte(nil)},
|
Ret: []interface{}{[]byte(nil)},
|
||||||
Size: []int{4000},
|
Size: []int{4000},
|
||||||
}
|
}
|
||||||
m.packRequest()
|
m.packRequest()
|
||||||
c.s.send(m)
|
c.s.send(m)
|
||||||
|
|
|
||||||
|
|
@ -34,19 +34,19 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var errstr = [...]string{
|
var errstr = [...]string{
|
||||||
OK - OK: "ok",
|
OK - OK: "ok",
|
||||||
ErrBreak - OK: "break",
|
ErrBreak - OK: "break",
|
||||||
ErrMessageTruncated - OK: "message truncated",
|
ErrMessageTruncated - OK: "message truncated",
|
||||||
ErrNoMemory - OK: "out of memory",
|
ErrNoMemory - OK: "out of memory",
|
||||||
ErrProtocolMismatch - OK: "protocol mismatch",
|
ErrProtocolMismatch - OK: "protocol mismatch",
|
||||||
ErrBadRPCNumber - OK: "invalid RPC method number",
|
ErrBadRPCNumber - OK: "invalid RPC method number",
|
||||||
ErrBadArgType - OK: "unexpected argument type",
|
ErrBadArgType - OK: "unexpected argument type",
|
||||||
ErrTooFewArgs - OK: "too few arguments",
|
ErrTooFewArgs - OK: "too few arguments",
|
||||||
ErrTooManyArgs - OK: "too many arguments",
|
ErrTooManyArgs - OK: "too many arguments",
|
||||||
ErrInArgTypeMismatch - OK: "input argument type mismatch",
|
ErrInArgTypeMismatch - OK: "input argument type mismatch",
|
||||||
ErrOutArgTypeMismatch - OK: "output argument type mismatch",
|
ErrOutArgTypeMismatch - OK: "output argument type mismatch",
|
||||||
ErrInternalError - OK: "internal error",
|
ErrInternalError - OK: "internal error",
|
||||||
ErrAppError - OK: "application error",
|
ErrAppError - OK: "application error",
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e Errno) String() string {
|
func (e Errno) String() string {
|
||||||
|
|
|
||||||
|
|
@ -106,14 +106,14 @@ type Process struct {
|
||||||
// process, an architecture, and a symbol table.
|
// process, an architecture, and a symbol table.
|
||||||
func NewProcess(tproc proc.Process, arch Arch, syms *gosym.Table) (*Process, os.Error) {
|
func NewProcess(tproc proc.Process, arch Arch, syms *gosym.Table) (*Process, os.Error) {
|
||||||
p := &Process{
|
p := &Process{
|
||||||
Arch: arch,
|
Arch: arch,
|
||||||
proc: tproc,
|
proc: tproc,
|
||||||
syms: syms,
|
syms: syms,
|
||||||
types: make(map[proc.Word]*remoteType),
|
types: make(map[proc.Word]*remoteType),
|
||||||
breakpointHooks: make(map[proc.Word]*breakpointHook),
|
breakpointHooks: make(map[proc.Word]*breakpointHook),
|
||||||
goroutineCreateHook: new(goroutineCreateHook),
|
goroutineCreateHook: new(goroutineCreateHook),
|
||||||
goroutineExitHook: new(goroutineExitHook),
|
goroutineExitHook: new(goroutineExitHook),
|
||||||
goroutines: make(map[proc.Word]*Goroutine),
|
goroutines: make(map[proc.Word]*Goroutine),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fill in remote runtime
|
// Fill in remote runtime
|
||||||
|
|
|
||||||
|
|
@ -141,13 +141,13 @@ type rt1G struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var rt1GStatus = runtimeGStatus{
|
var rt1GStatus = runtimeGStatus{
|
||||||
Gidle: 0,
|
Gidle: 0,
|
||||||
Grunnable: 1,
|
Grunnable: 1,
|
||||||
Grunning: 2,
|
Grunning: 2,
|
||||||
Gsyscall: 3,
|
Gsyscall: 3,
|
||||||
Gwaiting: 4,
|
Gwaiting: 4,
|
||||||
Gmoribund: 5,
|
Gmoribund: 5,
|
||||||
Gdead: 6,
|
Gdead: 6,
|
||||||
}
|
}
|
||||||
|
|
||||||
// runtimeIndexes stores the indexes of fields in the runtime
|
// runtimeIndexes stores the indexes of fields in the runtime
|
||||||
|
|
|
||||||
|
|
@ -121,14 +121,14 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var ctlBits = [...]pdp1.Word{
|
var ctlBits = [...]pdp1.Word{
|
||||||
'f': 0000001,
|
'f': 0000001,
|
||||||
'd': 0000002,
|
'd': 0000002,
|
||||||
'a': 0000004,
|
'a': 0000004,
|
||||||
's': 0000010,
|
's': 0000010,
|
||||||
'\'': 0040000,
|
'\'': 0040000,
|
||||||
';': 0100000,
|
';': 0100000,
|
||||||
'k': 0200000,
|
'k': 0200000,
|
||||||
'l': 0400000,
|
'l': 0400000,
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SpacewarPDP1) Step() os.Error {
|
func (m *SpacewarPDP1) Step() os.Error {
|
||||||
|
|
|
||||||
|
|
@ -159,15 +159,17 @@ func (p *printer) exprList(prev token.Position, list []ast.Expr, depth int, mode
|
||||||
ws = indent
|
ws = indent
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oneLiner := false // true if the previous expression fit on a single line
|
||||||
|
prevBreak := -1 // index of last expression that was followed by a linebreak
|
||||||
|
|
||||||
// the first linebreak is always a formfeed since this section must not
|
// the first linebreak is always a formfeed since this section must not
|
||||||
// depend on any previous formatting
|
// depend on any previous formatting
|
||||||
if prev.IsValid() && prev.Line < line && p.linebreak(line, 1, 2, ws, true) {
|
if prev.IsValid() && prev.Line < line && p.linebreak(line, 1, 2, ws, true) {
|
||||||
ws = ignore
|
ws = ignore
|
||||||
*multiLine = true
|
*multiLine = true
|
||||||
|
prevBreak = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
oneLiner := false // true if the previous expression fit on a single line
|
|
||||||
prevBreak := 0 // index of last expression that was followed by a linebreak
|
|
||||||
for i, x := range list {
|
for i, x := range list {
|
||||||
prev := line
|
prev := line
|
||||||
line = x.Pos().Line
|
line = x.Pos().Line
|
||||||
|
|
@ -189,12 +191,20 @@ func (p *printer) exprList(prev token.Position, list []ast.Expr, depth int, mode
|
||||||
p.print(blank)
|
p.print(blank)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.expr0(x, depth, multiLine)
|
|
||||||
// determine if x satisfies the "one-liner" criteria
|
// determine if x satisfies the "one-liner" criteria
|
||||||
// TODO(gri): determine if the multiline information returned
|
// TODO(gri): determine if the multiline information returned
|
||||||
// from p.expr0 is precise enough so it could be
|
// from p.expr0 is precise enough so it could be
|
||||||
// used instead
|
// used instead
|
||||||
oneLiner = p.isOneLineExpr(x)
|
oneLiner = p.isOneLineExpr(x)
|
||||||
|
if t, isPair := x.(*ast.KeyValueExpr); isPair && oneLiner && len(list) > 1 {
|
||||||
|
// we have a key:value expression that fits onto one line, and
|
||||||
|
// is a list with more then one entry: align all the values
|
||||||
|
p.expr(t.Key, multiLine)
|
||||||
|
p.print(t.Colon, token.COLON, vtab)
|
||||||
|
p.expr(t.Value, multiLine)
|
||||||
|
} else {
|
||||||
|
p.expr0(x, depth, multiLine)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if mode&commaTerm != 0 && next.IsValid() && p.pos.Line < next.Line {
|
if mode&commaTerm != 0 && next.IsValid() && p.pos.Line < next.Line {
|
||||||
|
|
|
||||||
70
src/pkg/go/printer/testdata/declarations.golden
vendored
70
src/pkg/go/printer/testdata/declarations.golden
vendored
|
|
@ -462,45 +462,57 @@ func _() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func _() {
|
||||||
|
var privateKey2 = &Block{Type: "RSA PRIVATE KEY",
|
||||||
|
Headers: map[string]string{},
|
||||||
|
Bytes: []uint8{0x30, 0x82, 0x1, 0x3a, 0x2, 0x1, 0x0, 0x2,
|
||||||
|
0x41, 0x0, 0xb2, 0x99, 0xf, 0x49, 0xc4, 0x7d, 0xfa, 0x8c,
|
||||||
|
0xd4, 0x0, 0xae, 0x6a, 0x4d, 0x1b, 0x8a, 0x3b, 0x6a, 0x13,
|
||||||
|
0x64, 0x2b, 0x23, 0xf2, 0x8b, 0x0, 0x3b, 0xfb, 0x97, 0x79,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
func _() {
|
func _() {
|
||||||
var Universe = Scope{
|
var Universe = Scope{
|
||||||
Names: map[string]*Ident{
|
Names: map[string]*Ident{
|
||||||
// basic types
|
// basic types
|
||||||
"bool": nil,
|
"bool": nil,
|
||||||
"byte": nil,
|
"byte": nil,
|
||||||
"int8": nil,
|
"int8": nil,
|
||||||
"int16": nil,
|
"int16": nil,
|
||||||
"int32": nil,
|
"int32": nil,
|
||||||
"int64": nil,
|
"int64": nil,
|
||||||
"uint8": nil,
|
"uint8": nil,
|
||||||
"uint16": nil,
|
"uint16": nil,
|
||||||
"uint32": nil,
|
"uint32": nil,
|
||||||
"uint64": nil,
|
"uint64": nil,
|
||||||
"float32": nil,
|
"float32": nil,
|
||||||
"float64": nil,
|
"float64": nil,
|
||||||
"string": nil,
|
"string": nil,
|
||||||
|
|
||||||
// convenience types
|
// convenience types
|
||||||
"int": nil,
|
"int": nil,
|
||||||
"uint": nil,
|
"uint": nil,
|
||||||
"uintptr": nil,
|
"uintptr": nil,
|
||||||
"float": nil,
|
"float": nil,
|
||||||
|
|
||||||
// constants
|
// constants
|
||||||
"false": nil,
|
"false": nil,
|
||||||
"true": nil,
|
"true": nil,
|
||||||
"iota": nil,
|
"iota": nil,
|
||||||
"nil": nil,
|
"nil": nil,
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
"cap": nil,
|
"cap": nil,
|
||||||
"len": nil,
|
"len": nil,
|
||||||
"new": nil,
|
"new": nil,
|
||||||
"make": nil,
|
"make": nil,
|
||||||
"panic": nil,
|
"panic": nil,
|
||||||
"panicln": nil,
|
"panicln": nil,
|
||||||
"print": nil,
|
"print": nil,
|
||||||
"println": nil,
|
"println": nil,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
12
src/pkg/go/printer/testdata/declarations.input
vendored
12
src/pkg/go/printer/testdata/declarations.input
vendored
|
|
@ -459,6 +459,18 @@ func _() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func _() {
|
||||||
|
var privateKey2 = &Block{Type: "RSA PRIVATE KEY",
|
||||||
|
Headers: map[string]string{},
|
||||||
|
Bytes: []uint8{0x30, 0x82, 0x1, 0x3a, 0x2, 0x1, 0x0, 0x2,
|
||||||
|
0x41, 0x0, 0xb2, 0x99, 0xf, 0x49, 0xc4, 0x7d, 0xfa, 0x8c,
|
||||||
|
0xd4, 0x0, 0xae, 0x6a, 0x4d, 0x1b, 0x8a, 0x3b, 0x6a, 0x13,
|
||||||
|
0x64, 0x2b, 0x23, 0xf2, 0x8b, 0x0, 0x3b, 0xfb, 0x97, 0x79,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
func _() {
|
func _() {
|
||||||
var Universe = Scope {
|
var Universe = Scope {
|
||||||
Names: map[string]*Ident {
|
Names: map[string]*Ident {
|
||||||
|
|
|
||||||
186
src/pkg/go/printer/testdata/linebreaks.golden
vendored
186
src/pkg/go/printer/testdata/linebreaks.golden
vendored
|
|
@ -26,35 +26,35 @@ type writerTest struct {
|
||||||
|
|
||||||
var writerTests = []*writerTest{
|
var writerTests = []*writerTest{
|
||||||
&writerTest{
|
&writerTest{
|
||||||
file: "testdata/writer.tar",
|
file: "testdata/writer.tar",
|
||||||
entries: []*writerTestEntry{
|
entries: []*writerTestEntry{
|
||||||
&writerTestEntry{
|
&writerTestEntry{
|
||||||
header: &Header{
|
header: &Header{
|
||||||
Name: "small.txt",
|
Name: "small.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 5,
|
Size: 5,
|
||||||
Mtime: 1246508266,
|
Mtime: 1246508266,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
contents: "Kilts",
|
contents: "Kilts",
|
||||||
},
|
},
|
||||||
&writerTestEntry{
|
&writerTestEntry{
|
||||||
header: &Header{
|
header: &Header{
|
||||||
Name: "small2.txt",
|
Name: "small2.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 11,
|
Size: 11,
|
||||||
Mtime: 1245217492,
|
Mtime: 1245217492,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
contents: "Google.com\n",
|
contents: "Google.com\n",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -62,19 +62,19 @@ var writerTests = []*writerTest{
|
||||||
// dd if=/dev/zero bs=1048576 count=16384 > /tmp/16gig.txt
|
// dd if=/dev/zero bs=1048576 count=16384 > /tmp/16gig.txt
|
||||||
// tar -b 1 -c -f- /tmp/16gig.txt | dd bs=512 count=8 > writer-big.tar
|
// tar -b 1 -c -f- /tmp/16gig.txt | dd bs=512 count=8 > writer-big.tar
|
||||||
&writerTest{
|
&writerTest{
|
||||||
file: "testdata/writer-big.tar",
|
file: "testdata/writer-big.tar",
|
||||||
entries: []*writerTestEntry{
|
entries: []*writerTestEntry{
|
||||||
&writerTestEntry{
|
&writerTestEntry{
|
||||||
header: &Header{
|
header: &Header{
|
||||||
Name: "tmp/16gig.txt",
|
Name: "tmp/16gig.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 16 << 30,
|
Size: 16 << 30,
|
||||||
Mtime: 1254699560,
|
Mtime: 1254699560,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
// no contents
|
// no contents
|
||||||
},
|
},
|
||||||
|
|
@ -89,94 +89,94 @@ type untarTest struct {
|
||||||
|
|
||||||
var untarTests = []*untarTest{
|
var untarTests = []*untarTest{
|
||||||
&untarTest{
|
&untarTest{
|
||||||
file: "testdata/gnu.tar",
|
file: "testdata/gnu.tar",
|
||||||
headers: []*Header{
|
headers: []*Header{
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small.txt",
|
Name: "small.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 5,
|
Size: 5,
|
||||||
Mtime: 1244428340,
|
Mtime: 1244428340,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small2.txt",
|
Name: "small2.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 11,
|
Size: 11,
|
||||||
Mtime: 1244436044,
|
Mtime: 1244436044,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&untarTest{
|
&untarTest{
|
||||||
file: "testdata/star.tar",
|
file: "testdata/star.tar",
|
||||||
headers: []*Header{
|
headers: []*Header{
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small.txt",
|
Name: "small.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 5,
|
Size: 5,
|
||||||
Mtime: 1244592783,
|
Mtime: 1244592783,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
Atime: 1244592783,
|
Atime: 1244592783,
|
||||||
Ctime: 1244592783,
|
Ctime: 1244592783,
|
||||||
},
|
},
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small2.txt",
|
Name: "small2.txt",
|
||||||
Mode: 0640,
|
Mode: 0640,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 11,
|
Size: 11,
|
||||||
Mtime: 1244592783,
|
Mtime: 1244592783,
|
||||||
Typeflag: '0',
|
Typeflag: '0',
|
||||||
Uname: "dsymonds",
|
Uname: "dsymonds",
|
||||||
Gname: "eng",
|
Gname: "eng",
|
||||||
Atime: 1244592783,
|
Atime: 1244592783,
|
||||||
Ctime: 1244592783,
|
Ctime: 1244592783,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
&untarTest{
|
&untarTest{
|
||||||
file: "testdata/v7.tar",
|
file: "testdata/v7.tar",
|
||||||
headers: []*Header{
|
headers: []*Header{
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small.txt",
|
Name: "small.txt",
|
||||||
Mode: 0444,
|
Mode: 0444,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 5,
|
Size: 5,
|
||||||
Mtime: 1244593104,
|
Mtime: 1244593104,
|
||||||
Typeflag: '\x00',
|
Typeflag: '\x00',
|
||||||
},
|
},
|
||||||
&Header{
|
&Header{
|
||||||
Name: "small2.txt",
|
Name: "small2.txt",
|
||||||
Mode: 0444,
|
Mode: 0444,
|
||||||
Uid: 73025,
|
Uid: 73025,
|
||||||
Gid: 5000,
|
Gid: 5000,
|
||||||
Size: 11,
|
Size: 11,
|
||||||
Mtime: 1244593104,
|
Mtime: 1244593104,
|
||||||
Typeflag: '\x00',
|
Typeflag: '\x00',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
var facts = map[int]string{
|
var facts = map[int]string{
|
||||||
0: "1",
|
0: "1",
|
||||||
1: "1",
|
1: "1",
|
||||||
2: "2",
|
2: "2",
|
||||||
10: "3628800",
|
10: "3628800",
|
||||||
20: "2432902008176640000",
|
20: "2432902008176640000",
|
||||||
100: "933262154439441526816992388562667004907159682643816214685929" +
|
100: "933262154439441526816992388562667004907159682643816214685929" +
|
||||||
"638952175999932299156089414639761565182862536979208272237582" +
|
"638952175999932299156089414639761565182862536979208272237582" +
|
||||||
"51185210916864000000000000000000000000",
|
"51185210916864000000000000000000000000",
|
||||||
|
|
|
||||||
|
|
@ -135,14 +135,14 @@ const (
|
||||||
var tokens = map[Token]string{
|
var tokens = map[Token]string{
|
||||||
ILLEGAL: "ILLEGAL",
|
ILLEGAL: "ILLEGAL",
|
||||||
|
|
||||||
EOF: "EOF",
|
EOF: "EOF",
|
||||||
COMMENT: "COMMENT",
|
COMMENT: "COMMENT",
|
||||||
|
|
||||||
IDENT: "IDENT",
|
IDENT: "IDENT",
|
||||||
INT: "INT",
|
INT: "INT",
|
||||||
FLOAT: "FLOAT",
|
FLOAT: "FLOAT",
|
||||||
IMAG: "IMAG",
|
IMAG: "IMAG",
|
||||||
CHAR: "CHAR",
|
CHAR: "CHAR",
|
||||||
STRING: "STRING",
|
STRING: "STRING",
|
||||||
|
|
||||||
ADD: "+",
|
ADD: "+",
|
||||||
|
|
@ -151,11 +151,11 @@ var tokens = map[Token]string{
|
||||||
QUO: "/",
|
QUO: "/",
|
||||||
REM: "%",
|
REM: "%",
|
||||||
|
|
||||||
AND: "&",
|
AND: "&",
|
||||||
OR: "|",
|
OR: "|",
|
||||||
XOR: "^",
|
XOR: "^",
|
||||||
SHL: "<<",
|
SHL: "<<",
|
||||||
SHR: ">>",
|
SHR: ">>",
|
||||||
AND_NOT: "&^",
|
AND_NOT: "&^",
|
||||||
|
|
||||||
ADD_ASSIGN: "+=",
|
ADD_ASSIGN: "+=",
|
||||||
|
|
@ -164,72 +164,72 @@ var tokens = map[Token]string{
|
||||||
QUO_ASSIGN: "/=",
|
QUO_ASSIGN: "/=",
|
||||||
REM_ASSIGN: "%=",
|
REM_ASSIGN: "%=",
|
||||||
|
|
||||||
AND_ASSIGN: "&=",
|
AND_ASSIGN: "&=",
|
||||||
OR_ASSIGN: "|=",
|
OR_ASSIGN: "|=",
|
||||||
XOR_ASSIGN: "^=",
|
XOR_ASSIGN: "^=",
|
||||||
SHL_ASSIGN: "<<=",
|
SHL_ASSIGN: "<<=",
|
||||||
SHR_ASSIGN: ">>=",
|
SHR_ASSIGN: ">>=",
|
||||||
AND_NOT_ASSIGN: "&^=",
|
AND_NOT_ASSIGN: "&^=",
|
||||||
|
|
||||||
LAND: "&&",
|
LAND: "&&",
|
||||||
LOR: "||",
|
LOR: "||",
|
||||||
ARROW: "<-",
|
ARROW: "<-",
|
||||||
INC: "++",
|
INC: "++",
|
||||||
DEC: "--",
|
DEC: "--",
|
||||||
|
|
||||||
EQL: "==",
|
EQL: "==",
|
||||||
LSS: "<",
|
LSS: "<",
|
||||||
GTR: ">",
|
GTR: ">",
|
||||||
ASSIGN: "=",
|
ASSIGN: "=",
|
||||||
NOT: "!",
|
NOT: "!",
|
||||||
|
|
||||||
NEQ: "!=",
|
NEQ: "!=",
|
||||||
LEQ: "<=",
|
LEQ: "<=",
|
||||||
GEQ: ">=",
|
GEQ: ">=",
|
||||||
DEFINE: ":=",
|
DEFINE: ":=",
|
||||||
ELLIPSIS: "...",
|
ELLIPSIS: "...",
|
||||||
|
|
||||||
LPAREN: "(",
|
LPAREN: "(",
|
||||||
LBRACK: "[",
|
LBRACK: "[",
|
||||||
LBRACE: "{",
|
LBRACE: "{",
|
||||||
COMMA: ",",
|
COMMA: ",",
|
||||||
PERIOD: ".",
|
PERIOD: ".",
|
||||||
|
|
||||||
RPAREN: ")",
|
RPAREN: ")",
|
||||||
RBRACK: "]",
|
RBRACK: "]",
|
||||||
RBRACE: "}",
|
RBRACE: "}",
|
||||||
SEMICOLON: ";",
|
SEMICOLON: ";",
|
||||||
COLON: ":",
|
COLON: ":",
|
||||||
|
|
||||||
BREAK: "break",
|
BREAK: "break",
|
||||||
CASE: "case",
|
CASE: "case",
|
||||||
CHAN: "chan",
|
CHAN: "chan",
|
||||||
CONST: "const",
|
CONST: "const",
|
||||||
CONTINUE: "continue",
|
CONTINUE: "continue",
|
||||||
|
|
||||||
DEFAULT: "default",
|
DEFAULT: "default",
|
||||||
DEFER: "defer",
|
DEFER: "defer",
|
||||||
ELSE: "else",
|
ELSE: "else",
|
||||||
FALLTHROUGH: "fallthrough",
|
FALLTHROUGH: "fallthrough",
|
||||||
FOR: "for",
|
FOR: "for",
|
||||||
|
|
||||||
FUNC: "func",
|
FUNC: "func",
|
||||||
GO: "go",
|
GO: "go",
|
||||||
GOTO: "goto",
|
GOTO: "goto",
|
||||||
IF: "if",
|
IF: "if",
|
||||||
IMPORT: "import",
|
IMPORT: "import",
|
||||||
|
|
||||||
INTERFACE: "interface",
|
INTERFACE: "interface",
|
||||||
MAP: "map",
|
MAP: "map",
|
||||||
PACKAGE: "package",
|
PACKAGE: "package",
|
||||||
RANGE: "range",
|
RANGE: "range",
|
||||||
RETURN: "return",
|
RETURN: "return",
|
||||||
|
|
||||||
SELECT: "select",
|
SELECT: "select",
|
||||||
STRUCT: "struct",
|
STRUCT: "struct",
|
||||||
SWITCH: "switch",
|
SWITCH: "switch",
|
||||||
TYPE: "type",
|
TYPE: "type",
|
||||||
VAR: "var",
|
VAR: "var",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -580,15 +580,15 @@ func TestEndToEnd(t *testing.T) {
|
||||||
t *T2
|
t *T2
|
||||||
}
|
}
|
||||||
t1 := &T1{
|
t1 := &T1{
|
||||||
a: 17,
|
a: 17,
|
||||||
b: 18,
|
b: 18,
|
||||||
c: -5,
|
c: -5,
|
||||||
n: &[3]float{1.5, 2.5, 3.5},
|
n: &[3]float{1.5, 2.5, 3.5},
|
||||||
strs: &[2]string{s1, s2},
|
strs: &[2]string{s1, s2},
|
||||||
int64s: &[]int64{77, 89, 123412342134},
|
int64s: &[]int64{77, 89, 123412342134},
|
||||||
s: "Now is the time",
|
s: "Now is the time",
|
||||||
y: []byte("hello, sailor"),
|
y: []byte("hello, sailor"),
|
||||||
t: &T2{"this is T2"},
|
t: &T2{"this is T2"},
|
||||||
}
|
}
|
||||||
b := new(bytes.Buffer)
|
b := new(bytes.Buffer)
|
||||||
err := NewEncoder(b).Encode(t1)
|
err := NewEncoder(b).Encode(t1)
|
||||||
|
|
|
||||||
|
|
@ -486,26 +486,26 @@ func ignoreSlice(state *decodeState, elemOp decOp) os.Error {
|
||||||
}
|
}
|
||||||
|
|
||||||
var decOpMap = map[reflect.Type]decOp{
|
var decOpMap = map[reflect.Type]decOp{
|
||||||
valueKind(false): decBool,
|
valueKind(false): decBool,
|
||||||
valueKind(int8(0)): decInt8,
|
valueKind(int8(0)): decInt8,
|
||||||
valueKind(int16(0)): decInt16,
|
valueKind(int16(0)): decInt16,
|
||||||
valueKind(int32(0)): decInt32,
|
valueKind(int32(0)): decInt32,
|
||||||
valueKind(int64(0)): decInt64,
|
valueKind(int64(0)): decInt64,
|
||||||
valueKind(uint8(0)): decUint8,
|
valueKind(uint8(0)): decUint8,
|
||||||
valueKind(uint16(0)): decUint16,
|
valueKind(uint16(0)): decUint16,
|
||||||
valueKind(uint32(0)): decUint32,
|
valueKind(uint32(0)): decUint32,
|
||||||
valueKind(uint64(0)): decUint64,
|
valueKind(uint64(0)): decUint64,
|
||||||
valueKind(float32(0)): decFloat32,
|
valueKind(float32(0)): decFloat32,
|
||||||
valueKind(float64(0)): decFloat64,
|
valueKind(float64(0)): decFloat64,
|
||||||
valueKind("x"): decString,
|
valueKind("x"): decString,
|
||||||
}
|
}
|
||||||
|
|
||||||
var decIgnoreOpMap = map[typeId]decOp{
|
var decIgnoreOpMap = map[typeId]decOp{
|
||||||
tBool: ignoreUint,
|
tBool: ignoreUint,
|
||||||
tInt: ignoreUint,
|
tInt: ignoreUint,
|
||||||
tUint: ignoreUint,
|
tUint: ignoreUint,
|
||||||
tFloat: ignoreUint,
|
tFloat: ignoreUint,
|
||||||
tBytes: ignoreUint8Array,
|
tBytes: ignoreUint8Array,
|
||||||
tString: ignoreUint8Array,
|
tString: ignoreUint8Array,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -320,22 +320,22 @@ func encodeArray(b *bytes.Buffer, p uintptr, op encOp, elemWid uintptr, length i
|
||||||
}
|
}
|
||||||
|
|
||||||
var encOpMap = map[reflect.Type]encOp{
|
var encOpMap = map[reflect.Type]encOp{
|
||||||
valueKind(false): encBool,
|
valueKind(false): encBool,
|
||||||
valueKind(int(0)): encInt,
|
valueKind(int(0)): encInt,
|
||||||
valueKind(int8(0)): encInt8,
|
valueKind(int8(0)): encInt8,
|
||||||
valueKind(int16(0)): encInt16,
|
valueKind(int16(0)): encInt16,
|
||||||
valueKind(int32(0)): encInt32,
|
valueKind(int32(0)): encInt32,
|
||||||
valueKind(int64(0)): encInt64,
|
valueKind(int64(0)): encInt64,
|
||||||
valueKind(uint(0)): encUint,
|
valueKind(uint(0)): encUint,
|
||||||
valueKind(uint8(0)): encUint8,
|
valueKind(uint8(0)): encUint8,
|
||||||
valueKind(uint16(0)): encUint16,
|
valueKind(uint16(0)): encUint16,
|
||||||
valueKind(uint32(0)): encUint32,
|
valueKind(uint32(0)): encUint32,
|
||||||
valueKind(uint64(0)): encUint64,
|
valueKind(uint64(0)): encUint64,
|
||||||
valueKind(uintptr(0)): encUintptr,
|
valueKind(uintptr(0)): encUintptr,
|
||||||
valueKind(float(0)): encFloat,
|
valueKind(float(0)): encFloat,
|
||||||
valueKind(float32(0)): encFloat32,
|
valueKind(float32(0)): encFloat32,
|
||||||
valueKind(float64(0)): encFloat64,
|
valueKind(float64(0)): encFloat64,
|
||||||
valueKind("x"): encString,
|
valueKind("x"): encString,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return the encoding op for the base type under rt and
|
// Return the encoding op for the base type under rt and
|
||||||
|
|
|
||||||
|
|
@ -16,29 +16,29 @@ type lexTest struct {
|
||||||
|
|
||||||
var lexTests = []lexTest{
|
var lexTests = []lexTest{
|
||||||
lexTest{
|
lexTest{
|
||||||
Raw: `"abc"def,:ghi`,
|
Raw: `"abc"def,:ghi`,
|
||||||
Parsed: 13,
|
Parsed: 13,
|
||||||
Result: []string{"abcdef", "ghi"},
|
Result: []string{"abcdef", "ghi"},
|
||||||
},
|
},
|
||||||
// My understanding of the RFC is that escape sequences outside of
|
// My understanding of the RFC is that escape sequences outside of
|
||||||
// quotes are not interpreted?
|
// quotes are not interpreted?
|
||||||
lexTest{
|
lexTest{
|
||||||
Raw: `"\t"\t"\t"`,
|
Raw: `"\t"\t"\t"`,
|
||||||
Parsed: 10,
|
Parsed: 10,
|
||||||
Result: []string{"\t", "t\t"},
|
Result: []string{"\t", "t\t"},
|
||||||
},
|
},
|
||||||
lexTest{
|
lexTest{
|
||||||
Raw: `"\yab"\r\n`,
|
Raw: `"\yab"\r\n`,
|
||||||
Parsed: 10,
|
Parsed: 10,
|
||||||
Result: []string{"?ab", "r", "n"},
|
Result: []string{"?ab", "r", "n"},
|
||||||
},
|
},
|
||||||
lexTest{
|
lexTest{
|
||||||
Raw: "ab\f",
|
Raw: "ab\f",
|
||||||
Parsed: 3,
|
Parsed: 3,
|
||||||
Result: []string{"ab?"},
|
Result: []string{"ab?"},
|
||||||
},
|
},
|
||||||
lexTest{
|
lexTest{
|
||||||
Raw: "\"ab \" c,de f, gh, ij\n\t\r",
|
Raw: "\"ab \" c,de f, gh, ij\n\t\r",
|
||||||
Parsed: 23,
|
Parsed: 23,
|
||||||
Result: []string{"ab ", "c", "de", "f", "gh", "ij"},
|
Result: []string{"ab ", "c", "de", "f", "gh", "ij"},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -37,34 +37,34 @@ var reqTests = []reqTest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
RawURL: "http://www.techcrunch.com/",
|
RawURL: "http://www.techcrunch.com/",
|
||||||
URL: &URL{
|
URL: &URL{
|
||||||
Raw: "http://www.techcrunch.com/",
|
Raw: "http://www.techcrunch.com/",
|
||||||
Scheme: "http",
|
Scheme: "http",
|
||||||
RawPath: "//www.techcrunch.com/",
|
RawPath: "//www.techcrunch.com/",
|
||||||
Authority: "www.techcrunch.com",
|
Authority: "www.techcrunch.com",
|
||||||
Userinfo: "",
|
Userinfo: "",
|
||||||
Host: "www.techcrunch.com",
|
Host: "www.techcrunch.com",
|
||||||
Path: "/",
|
Path: "/",
|
||||||
RawQuery: "",
|
RawQuery: "",
|
||||||
Fragment: "",
|
Fragment: "",
|
||||||
},
|
},
|
||||||
Proto: "HTTP/1.1",
|
Proto: "HTTP/1.1",
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 1,
|
ProtoMinor: 1,
|
||||||
Header: map[string]string{
|
Header: map[string]string{
|
||||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||||
"Accept-Language": "en-us,en;q=0.5",
|
"Accept-Language": "en-us,en;q=0.5",
|
||||||
"Accept-Encoding": "gzip,deflate",
|
"Accept-Encoding": "gzip,deflate",
|
||||||
"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
|
"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
|
||||||
"Keep-Alive": "300",
|
"Keep-Alive": "300",
|
||||||
"Proxy-Connection": "keep-alive",
|
"Proxy-Connection": "keep-alive",
|
||||||
"Content-Length": "7",
|
"Content-Length": "7",
|
||||||
},
|
},
|
||||||
Close: false,
|
Close: false,
|
||||||
ContentLength: 7,
|
ContentLength: 7,
|
||||||
Host: "www.techcrunch.com",
|
Host: "www.techcrunch.com",
|
||||||
Referer: "",
|
Referer: "",
|
||||||
UserAgent: "Fake",
|
UserAgent: "Fake",
|
||||||
Form: map[string][]string{},
|
Form: map[string][]string{},
|
||||||
},
|
},
|
||||||
|
|
||||||
"abcdef\n",
|
"abcdef\n",
|
||||||
|
|
|
||||||
|
|
@ -50,12 +50,12 @@ type badStringError struct {
|
||||||
func (e *badStringError) String() string { return fmt.Sprintf("%s %q", e.what, e.str) }
|
func (e *badStringError) String() string { return fmt.Sprintf("%s %q", e.what, e.str) }
|
||||||
|
|
||||||
var reqExcludeHeader = map[string]int{
|
var reqExcludeHeader = map[string]int{
|
||||||
"Host": 0,
|
"Host": 0,
|
||||||
"User-Agent": 0,
|
"User-Agent": 0,
|
||||||
"Referer": 0,
|
"Referer": 0,
|
||||||
"Content-Length": 0,
|
"Content-Length": 0,
|
||||||
"Transfer-Encoding": 0,
|
"Transfer-Encoding": 0,
|
||||||
"Trailer": 0,
|
"Trailer": 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
// A Request represents a parsed HTTP request header.
|
// A Request represents a parsed HTTP request header.
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,15 @@ type parseTest struct {
|
||||||
var parseTests = []parseTest{
|
var parseTests = []parseTest{
|
||||||
parseTest{
|
parseTest{
|
||||||
query: "a=1&b=2",
|
query: "a=1&b=2",
|
||||||
out: stringMultimap{"a": []string{"1"}, "b": []string{"2"}},
|
out: stringMultimap{"a": []string{"1"}, "b": []string{"2"}},
|
||||||
},
|
},
|
||||||
parseTest{
|
parseTest{
|
||||||
query: "a=1&a=2&a=banana",
|
query: "a=1&a=2&a=banana",
|
||||||
out: stringMultimap{"a": []string{"1", "2", "banana"}},
|
out: stringMultimap{"a": []string{"1", "2", "banana"}},
|
||||||
},
|
},
|
||||||
parseTest{
|
parseTest{
|
||||||
query: "ascii=%3Ckey%3A+0x90%3E",
|
query: "ascii=%3Ckey%3A+0x90%3E",
|
||||||
out: stringMultimap{"ascii": []string{"<key: 0x90>"}},
|
out: stringMultimap{"ascii": []string{"<key: 0x90>"}},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,7 +90,7 @@ func TestPostContentTypeParsing(t *testing.T) {
|
||||||
req := &Request{
|
req := &Request{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
Header: test.contentType,
|
Header: test.contentType,
|
||||||
Body: nopCloser{bytes.NewBufferString("body")},
|
Body: nopCloser{bytes.NewBufferString("body")},
|
||||||
}
|
}
|
||||||
err := req.ParseForm()
|
err := req.ParseForm()
|
||||||
if !test.error && err != nil {
|
if !test.error && err != nil {
|
||||||
|
|
|
||||||
|
|
@ -21,33 +21,33 @@ var reqWriteTests = []reqWriteTest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
RawURL: "http://www.techcrunch.com/",
|
RawURL: "http://www.techcrunch.com/",
|
||||||
URL: &URL{
|
URL: &URL{
|
||||||
Raw: "http://www.techcrunch.com/",
|
Raw: "http://www.techcrunch.com/",
|
||||||
Scheme: "http",
|
Scheme: "http",
|
||||||
RawPath: "//www.techcrunch.com/",
|
RawPath: "//www.techcrunch.com/",
|
||||||
Authority: "www.techcrunch.com",
|
Authority: "www.techcrunch.com",
|
||||||
Userinfo: "",
|
Userinfo: "",
|
||||||
Host: "www.techcrunch.com",
|
Host: "www.techcrunch.com",
|
||||||
Path: "/",
|
Path: "/",
|
||||||
RawQuery: "",
|
RawQuery: "",
|
||||||
Fragment: "",
|
Fragment: "",
|
||||||
},
|
},
|
||||||
Proto: "HTTP/1.1",
|
Proto: "HTTP/1.1",
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 1,
|
ProtoMinor: 1,
|
||||||
Header: map[string]string{
|
Header: map[string]string{
|
||||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
||||||
"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
|
"Accept-Charset": "ISO-8859-1,utf-8;q=0.7,*;q=0.7",
|
||||||
"Accept-Encoding": "gzip,deflate",
|
"Accept-Encoding": "gzip,deflate",
|
||||||
"Accept-Language": "en-us,en;q=0.5",
|
"Accept-Language": "en-us,en;q=0.5",
|
||||||
"Keep-Alive": "300",
|
"Keep-Alive": "300",
|
||||||
"Proxy-Connection": "keep-alive",
|
"Proxy-Connection": "keep-alive",
|
||||||
},
|
},
|
||||||
Body: nil,
|
Body: nil,
|
||||||
Close: false,
|
Close: false,
|
||||||
Host: "www.techcrunch.com",
|
Host: "www.techcrunch.com",
|
||||||
Referer: "",
|
Referer: "",
|
||||||
UserAgent: "Fake",
|
UserAgent: "Fake",
|
||||||
Form: map[string][]string{},
|
Form: map[string][]string{},
|
||||||
},
|
},
|
||||||
|
|
||||||
"GET http://www.techcrunch.com/ HTTP/1.1\r\n" +
|
"GET http://www.techcrunch.com/ HTTP/1.1\r\n" +
|
||||||
|
|
@ -66,13 +66,13 @@ var reqWriteTests = []reqWriteTest{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
URL: &URL{
|
URL: &URL{
|
||||||
Scheme: "http",
|
Scheme: "http",
|
||||||
Host: "www.google.com",
|
Host: "www.google.com",
|
||||||
Path: "/search",
|
Path: "/search",
|
||||||
},
|
},
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 1,
|
ProtoMinor: 1,
|
||||||
Header: map[string]string{},
|
Header: map[string]string{},
|
||||||
Body: nopCloser{bytes.NewBufferString("abcdef")},
|
Body: nopCloser{bytes.NewBufferString("abcdef")},
|
||||||
TransferEncoding: []string{"chunked"},
|
TransferEncoding: []string{"chunked"},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -88,14 +88,14 @@ var reqWriteTests = []reqWriteTest{
|
||||||
Method: "POST",
|
Method: "POST",
|
||||||
URL: &URL{
|
URL: &URL{
|
||||||
Scheme: "http",
|
Scheme: "http",
|
||||||
Host: "www.google.com",
|
Host: "www.google.com",
|
||||||
Path: "/search",
|
Path: "/search",
|
||||||
},
|
},
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 1,
|
ProtoMinor: 1,
|
||||||
Header: map[string]string{},
|
Header: map[string]string{},
|
||||||
Close: true,
|
Close: true,
|
||||||
Body: nopCloser{bytes.NewBufferString("abcdef")},
|
Body: nopCloser{bytes.NewBufferString("abcdef")},
|
||||||
TransferEncoding: []string{"chunked"},
|
TransferEncoding: []string{"chunked"},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -111,7 +111,7 @@ var reqWriteTests = []reqWriteTest{
|
||||||
Request{
|
Request{
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
RawURL: "/search",
|
RawURL: "/search",
|
||||||
Host: "www.google.com",
|
Host: "www.google.com",
|
||||||
},
|
},
|
||||||
|
|
||||||
"GET /search HTTP/1.1\r\n" +
|
"GET /search HTTP/1.1\r\n" +
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,9 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var respExcludeHeader = map[string]int{
|
var respExcludeHeader = map[string]int{
|
||||||
"Content-Length": 0,
|
"Content-Length": 0,
|
||||||
"Transfer-Encoding": 0,
|
"Transfer-Encoding": 0,
|
||||||
"Trailer": 0,
|
"Trailer": 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Response represents the response from an HTTP request.
|
// Response represents the response from an HTTP request.
|
||||||
|
|
|
||||||
|
|
@ -28,16 +28,16 @@ var respTests = []respTest{
|
||||||
"Body here\n",
|
"Body here\n",
|
||||||
|
|
||||||
Response{
|
Response{
|
||||||
Status: "200 OK",
|
Status: "200 OK",
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Proto: "HTTP/1.0",
|
Proto: "HTTP/1.0",
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 0,
|
ProtoMinor: 0,
|
||||||
RequestMethod: "GET",
|
RequestMethod: "GET",
|
||||||
Header: map[string]string{
|
Header: map[string]string{
|
||||||
"Connection": "close", // TODO(rsc): Delete?
|
"Connection": "close", // TODO(rsc): Delete?
|
||||||
},
|
},
|
||||||
Close: true,
|
Close: true,
|
||||||
ContentLength: -1,
|
ContentLength: -1,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -53,17 +53,17 @@ var respTests = []respTest{
|
||||||
"Body here\n",
|
"Body here\n",
|
||||||
|
|
||||||
Response{
|
Response{
|
||||||
Status: "200 OK",
|
Status: "200 OK",
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Proto: "HTTP/1.0",
|
Proto: "HTTP/1.0",
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 0,
|
ProtoMinor: 0,
|
||||||
RequestMethod: "GET",
|
RequestMethod: "GET",
|
||||||
Header: map[string]string{
|
Header: map[string]string{
|
||||||
"Connection": "close", // TODO(rsc): Delete?
|
"Connection": "close", // TODO(rsc): Delete?
|
||||||
"Content-Length": "10", // TODO(rsc): Delete?
|
"Content-Length": "10", // TODO(rsc): Delete?
|
||||||
},
|
},
|
||||||
Close: true,
|
Close: true,
|
||||||
ContentLength: 10,
|
ContentLength: 10,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -81,15 +81,15 @@ var respTests = []respTest{
|
||||||
"\r\n",
|
"\r\n",
|
||||||
|
|
||||||
Response{
|
Response{
|
||||||
Status: "200 OK",
|
Status: "200 OK",
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Proto: "HTTP/1.0",
|
Proto: "HTTP/1.0",
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 0,
|
ProtoMinor: 0,
|
||||||
RequestMethod: "GET",
|
RequestMethod: "GET",
|
||||||
Header: map[string]string{},
|
Header: map[string]string{},
|
||||||
Close: true,
|
Close: true,
|
||||||
ContentLength: -1,
|
ContentLength: -1,
|
||||||
TransferEncoding: []string{"chunked"},
|
TransferEncoding: []string{"chunked"},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -108,15 +108,15 @@ var respTests = []respTest{
|
||||||
"\r\n",
|
"\r\n",
|
||||||
|
|
||||||
Response{
|
Response{
|
||||||
Status: "200 OK",
|
Status: "200 OK",
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
Proto: "HTTP/1.0",
|
Proto: "HTTP/1.0",
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 0,
|
ProtoMinor: 0,
|
||||||
RequestMethod: "GET",
|
RequestMethod: "GET",
|
||||||
Header: map[string]string{},
|
Header: map[string]string{},
|
||||||
Close: true,
|
Close: true,
|
||||||
ContentLength: -1, // TODO(rsc): Fix?
|
ContentLength: -1, // TODO(rsc): Fix?
|
||||||
TransferEncoding: []string{"chunked"},
|
TransferEncoding: []string{"chunked"},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,12 +18,12 @@ var respWriteTests = []respWriteTest{
|
||||||
// HTTP/1.0, identity coding; no trailer
|
// HTTP/1.0, identity coding; no trailer
|
||||||
respWriteTest{
|
respWriteTest{
|
||||||
Response{
|
Response{
|
||||||
StatusCode: 503,
|
StatusCode: 503,
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 0,
|
ProtoMinor: 0,
|
||||||
RequestMethod: "GET",
|
RequestMethod: "GET",
|
||||||
Header: map[string]string{},
|
Header: map[string]string{},
|
||||||
Body: nopCloser{bytes.NewBufferString("abcdef")},
|
Body: nopCloser{bytes.NewBufferString("abcdef")},
|
||||||
ContentLength: 6,
|
ContentLength: 6,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -34,15 +34,15 @@ var respWriteTests = []respWriteTest{
|
||||||
// HTTP/1.1, chunked coding; empty trailer; close
|
// HTTP/1.1, chunked coding; empty trailer; close
|
||||||
respWriteTest{
|
respWriteTest{
|
||||||
Response{
|
Response{
|
||||||
StatusCode: 200,
|
StatusCode: 200,
|
||||||
ProtoMajor: 1,
|
ProtoMajor: 1,
|
||||||
ProtoMinor: 1,
|
ProtoMinor: 1,
|
||||||
RequestMethod: "GET",
|
RequestMethod: "GET",
|
||||||
Header: map[string]string{},
|
Header: map[string]string{},
|
||||||
Body: nopCloser{bytes.NewBufferString("abcdef")},
|
Body: nopCloser{bytes.NewBufferString("abcdef")},
|
||||||
ContentLength: 6,
|
ContentLength: 6,
|
||||||
TransferEncoding: []string{"chunked"},
|
TransferEncoding: []string{"chunked"},
|
||||||
Close: true,
|
Close: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
"HTTP/1.1 200 OK\r\n" +
|
"HTTP/1.1 200 OK\r\n" +
|
||||||
|
|
|
||||||
|
|
@ -53,48 +53,48 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var statusText = map[int]string{
|
var statusText = map[int]string{
|
||||||
StatusContinue: "Continue",
|
StatusContinue: "Continue",
|
||||||
StatusSwitchingProtocols: "Switching Protocols",
|
StatusSwitchingProtocols: "Switching Protocols",
|
||||||
|
|
||||||
StatusOK: "OK",
|
StatusOK: "OK",
|
||||||
StatusCreated: "Created",
|
StatusCreated: "Created",
|
||||||
StatusAccepted: "Accepted",
|
StatusAccepted: "Accepted",
|
||||||
StatusNonAuthoritativeInfo: "Non-Authoritative Information",
|
StatusNonAuthoritativeInfo: "Non-Authoritative Information",
|
||||||
StatusNoContent: "No Content",
|
StatusNoContent: "No Content",
|
||||||
StatusResetContent: "Reset Content",
|
StatusResetContent: "Reset Content",
|
||||||
StatusPartialContent: "Partial Content",
|
StatusPartialContent: "Partial Content",
|
||||||
|
|
||||||
StatusMultipleChoices: "Multiple Choices",
|
StatusMultipleChoices: "Multiple Choices",
|
||||||
StatusMovedPermanently: "Moved Permanently",
|
StatusMovedPermanently: "Moved Permanently",
|
||||||
StatusFound: "Found",
|
StatusFound: "Found",
|
||||||
StatusSeeOther: "See Other",
|
StatusSeeOther: "See Other",
|
||||||
StatusNotModified: "Not Modified",
|
StatusNotModified: "Not Modified",
|
||||||
StatusUseProxy: "Use Proxy",
|
StatusUseProxy: "Use Proxy",
|
||||||
StatusTemporaryRedirect: "Temporary Redirect",
|
StatusTemporaryRedirect: "Temporary Redirect",
|
||||||
|
|
||||||
StatusBadRequest: "Bad Request",
|
StatusBadRequest: "Bad Request",
|
||||||
StatusUnauthorized: "Unauthorized",
|
StatusUnauthorized: "Unauthorized",
|
||||||
StatusPaymentRequired: "Payment Required",
|
StatusPaymentRequired: "Payment Required",
|
||||||
StatusForbidden: "Forbidden",
|
StatusForbidden: "Forbidden",
|
||||||
StatusNotFound: "Not Found",
|
StatusNotFound: "Not Found",
|
||||||
StatusMethodNotAllowed: "Method Not Allowed",
|
StatusMethodNotAllowed: "Method Not Allowed",
|
||||||
StatusNotAcceptable: "Not Acceptable",
|
StatusNotAcceptable: "Not Acceptable",
|
||||||
StatusProxyAuthRequired: "Proxy Authentication Required",
|
StatusProxyAuthRequired: "Proxy Authentication Required",
|
||||||
StatusRequestTimeout: "Request Timeout",
|
StatusRequestTimeout: "Request Timeout",
|
||||||
StatusConflict: "Conflict",
|
StatusConflict: "Conflict",
|
||||||
StatusGone: "Gone",
|
StatusGone: "Gone",
|
||||||
StatusLengthRequired: "Length Required",
|
StatusLengthRequired: "Length Required",
|
||||||
StatusPreconditionFailed: "Precondition Failed",
|
StatusPreconditionFailed: "Precondition Failed",
|
||||||
StatusRequestEntityTooLarge: "Request Entity Too Large",
|
StatusRequestEntityTooLarge: "Request Entity Too Large",
|
||||||
StatusRequestURITooLong: "Request URI Too Long",
|
StatusRequestURITooLong: "Request URI Too Long",
|
||||||
StatusUnsupportedMediaType: "Unsupported Media Type",
|
StatusUnsupportedMediaType: "Unsupported Media Type",
|
||||||
StatusRequestedRangeNotSatisfiable: "Requested Range Not Satisfiable",
|
StatusRequestedRangeNotSatisfiable: "Requested Range Not Satisfiable",
|
||||||
StatusExpectationFailed: "Expectation Failed",
|
StatusExpectationFailed: "Expectation Failed",
|
||||||
|
|
||||||
StatusInternalServerError: "Internal Server Error",
|
StatusInternalServerError: "Internal Server Error",
|
||||||
StatusNotImplemented: "Not Implemented",
|
StatusNotImplemented: "Not Implemented",
|
||||||
StatusBadGateway: "Bad Gateway",
|
StatusBadGateway: "Bad Gateway",
|
||||||
StatusServiceUnavailable: "Service Unavailable",
|
StatusServiceUnavailable: "Service Unavailable",
|
||||||
StatusGatewayTimeout: "Gateway Timeout",
|
StatusGatewayTimeout: "Gateway Timeout",
|
||||||
StatusHTTPVersionNotSupported: "HTTP Version Not Supported",
|
StatusHTTPVersionNotSupported: "HTTP Version Not Supported",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ package mime
|
||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
var typeTests = map[string]string{
|
var typeTests = map[string]string{
|
||||||
".t1": "application/test",
|
".t1": "application/test",
|
||||||
".t2": "text/test; charset=utf-8",
|
".t2": "text/test; charset=utf-8",
|
||||||
".png": "image/png",
|
".png": "image/png",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,15 +26,15 @@ var typeFiles = []string{
|
||||||
}
|
}
|
||||||
|
|
||||||
var mimeTypes = map[string]string{
|
var mimeTypes = map[string]string{
|
||||||
".css": "text/css",
|
".css": "text/css",
|
||||||
".gif": "image/gif",
|
".gif": "image/gif",
|
||||||
".htm": "text/html; charset=utf-8",
|
".htm": "text/html; charset=utf-8",
|
||||||
".html": "text/html; charset=utf-8",
|
".html": "text/html; charset=utf-8",
|
||||||
".jpg": "image/jpeg",
|
".jpg": "image/jpeg",
|
||||||
".js": "application/x-javascript",
|
".js": "application/x-javascript",
|
||||||
".pdf": "application/pdf",
|
".pdf": "application/pdf",
|
||||||
".png": "image/png",
|
".png": "image/png",
|
||||||
".xml": "text/xml; charset=utf-8",
|
".xml": "text/xml; charset=utf-8",
|
||||||
}
|
}
|
||||||
|
|
||||||
func loadMimeFile(filename string) {
|
func loadMimeFile(filename string) {
|
||||||
|
|
|
||||||
|
|
@ -246,16 +246,16 @@ func (rr *_DNS_RR_A) Header() *_DNS_RR_Header { return &rr.Hdr }
|
||||||
var rr_mk = map[int]func() _DNS_RR{
|
var rr_mk = map[int]func() _DNS_RR{
|
||||||
_DNS_TypeCNAME: func() _DNS_RR { return new(_DNS_RR_CNAME) },
|
_DNS_TypeCNAME: func() _DNS_RR { return new(_DNS_RR_CNAME) },
|
||||||
_DNS_TypeHINFO: func() _DNS_RR { return new(_DNS_RR_HINFO) },
|
_DNS_TypeHINFO: func() _DNS_RR { return new(_DNS_RR_HINFO) },
|
||||||
_DNS_TypeMB: func() _DNS_RR { return new(_DNS_RR_MB) },
|
_DNS_TypeMB: func() _DNS_RR { return new(_DNS_RR_MB) },
|
||||||
_DNS_TypeMG: func() _DNS_RR { return new(_DNS_RR_MG) },
|
_DNS_TypeMG: func() _DNS_RR { return new(_DNS_RR_MG) },
|
||||||
_DNS_TypeMINFO: func() _DNS_RR { return new(_DNS_RR_MINFO) },
|
_DNS_TypeMINFO: func() _DNS_RR { return new(_DNS_RR_MINFO) },
|
||||||
_DNS_TypeMR: func() _DNS_RR { return new(_DNS_RR_MR) },
|
_DNS_TypeMR: func() _DNS_RR { return new(_DNS_RR_MR) },
|
||||||
_DNS_TypeMX: func() _DNS_RR { return new(_DNS_RR_MX) },
|
_DNS_TypeMX: func() _DNS_RR { return new(_DNS_RR_MX) },
|
||||||
_DNS_TypeNS: func() _DNS_RR { return new(_DNS_RR_NS) },
|
_DNS_TypeNS: func() _DNS_RR { return new(_DNS_RR_NS) },
|
||||||
_DNS_TypePTR: func() _DNS_RR { return new(_DNS_RR_PTR) },
|
_DNS_TypePTR: func() _DNS_RR { return new(_DNS_RR_PTR) },
|
||||||
_DNS_TypeSOA: func() _DNS_RR { return new(_DNS_RR_SOA) },
|
_DNS_TypeSOA: func() _DNS_RR { return new(_DNS_RR_SOA) },
|
||||||
_DNS_TypeTXT: func() _DNS_RR { return new(_DNS_RR_TXT) },
|
_DNS_TypeTXT: func() _DNS_RR { return new(_DNS_RR_TXT) },
|
||||||
_DNS_TypeA: func() _DNS_RR { return new(_DNS_RR_A) },
|
_DNS_TypeA: func() _DNS_RR { return new(_DNS_RR_A) },
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pack a domain name s into msg[off:].
|
// Pack a domain name s into msg[off:].
|
||||||
|
|
|
||||||
|
|
@ -301,12 +301,12 @@ func newFD(fd, family, proto int, net string, laddr, raddr Addr) (f *netFD, err
|
||||||
return nil, &OpError{"setnonblock", net, laddr, os.Errno(e)}
|
return nil, &OpError{"setnonblock", net, laddr, os.Errno(e)}
|
||||||
}
|
}
|
||||||
f = &netFD{
|
f = &netFD{
|
||||||
sysfd: fd,
|
sysfd: fd,
|
||||||
family: family,
|
family: family,
|
||||||
proto: proto,
|
proto: proto,
|
||||||
net: net,
|
net: net,
|
||||||
laddr: laddr,
|
laddr: laddr,
|
||||||
raddr: raddr,
|
raddr: raddr,
|
||||||
}
|
}
|
||||||
var ls, rs string
|
var ls, rs string
|
||||||
if laddr != nil {
|
if laddr != nil {
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ func NewExporter(network, localaddr string) (*Exporter, os.Error) {
|
||||||
}
|
}
|
||||||
e := &Exporter{
|
e := &Exporter{
|
||||||
listener: listener,
|
listener: listener,
|
||||||
chans: make(map[string]*exportChan),
|
chans: make(map[string]*exportChan),
|
||||||
}
|
}
|
||||||
go e.listen()
|
go e.listen()
|
||||||
return e, nil
|
return e, nil
|
||||||
|
|
|
||||||
|
|
@ -611,8 +611,8 @@ func (v *SliceValue) Elem(i int) Value {
|
||||||
func MakeSlice(typ *SliceType, len, cap int) *SliceValue {
|
func MakeSlice(typ *SliceType, len, cap int) *SliceValue {
|
||||||
s := &SliceHeader{
|
s := &SliceHeader{
|
||||||
Data: uintptr(unsafe.NewArray(typ.Elem(), cap)),
|
Data: uintptr(unsafe.NewArray(typ.Elem(), cap)),
|
||||||
Len: len,
|
Len: len,
|
||||||
Cap: cap,
|
Cap: cap,
|
||||||
}
|
}
|
||||||
return newValue(typ, addr(s), true).(*SliceValue)
|
return newValue(typ, addr(s), true).(*SliceValue)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -97,14 +97,14 @@ const (
|
||||||
|
|
||||||
|
|
||||||
var tokenString = map[int]string{
|
var tokenString = map[int]string{
|
||||||
EOF: "EOF",
|
EOF: "EOF",
|
||||||
Ident: "Ident",
|
Ident: "Ident",
|
||||||
Int: "Int",
|
Int: "Int",
|
||||||
Float: "Float",
|
Float: "Float",
|
||||||
Char: "Char",
|
Char: "Char",
|
||||||
String: "String",
|
String: "String",
|
||||||
RawString: "RawString",
|
RawString: "RawString",
|
||||||
Comment: "Comment",
|
Comment: "Comment",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -535,107 +535,107 @@ const (
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errors = [...]string{
|
||||||
7: "argument list too long",
|
7: "argument list too long",
|
||||||
13: "permission denied",
|
13: "permission denied",
|
||||||
48: "address already in use",
|
48: "address already in use",
|
||||||
49: "can't assign requested address",
|
49: "can't assign requested address",
|
||||||
47: "address family not supported by protocol family",
|
47: "address family not supported by protocol family",
|
||||||
35: "resource temporarily unavailable",
|
35: "resource temporarily unavailable",
|
||||||
37: "operation already in progress",
|
37: "operation already in progress",
|
||||||
80: "authentication error",
|
80: "authentication error",
|
||||||
86: "bad CPU type in executable",
|
86: "bad CPU type in executable",
|
||||||
85: "bad executable (or shared library)",
|
85: "bad executable (or shared library)",
|
||||||
9: "bad file descriptor",
|
9: "bad file descriptor",
|
||||||
88: "malformed Mach-o file",
|
88: "malformed Mach-o file",
|
||||||
94: "bad message",
|
94: "bad message",
|
||||||
72: "RPC struct is bad",
|
72: "RPC struct is bad",
|
||||||
16: "resource busy",
|
16: "resource busy",
|
||||||
89: "operation canceled",
|
89: "operation canceled",
|
||||||
10: "no child processes",
|
10: "no child processes",
|
||||||
53: "software caused connection abort",
|
53: "software caused connection abort",
|
||||||
61: "connection refused",
|
61: "connection refused",
|
||||||
54: "connection reset by peer",
|
54: "connection reset by peer",
|
||||||
11: "resource deadlock avoided",
|
11: "resource deadlock avoided",
|
||||||
39: "destination address required",
|
39: "destination address required",
|
||||||
83: "device error",
|
83: "device error",
|
||||||
33: "numerical argument out of domain",
|
33: "numerical argument out of domain",
|
||||||
69: "disc quota exceeded",
|
69: "disc quota exceeded",
|
||||||
17: "file exists",
|
17: "file exists",
|
||||||
14: "bad address",
|
14: "bad address",
|
||||||
27: "file too large",
|
27: "file too large",
|
||||||
79: "inappropriate file type or format",
|
79: "inappropriate file type or format",
|
||||||
64: "host is down",
|
64: "host is down",
|
||||||
65: "no route to host",
|
65: "no route to host",
|
||||||
90: "identifier removed",
|
90: "identifier removed",
|
||||||
92: "illegal byte sequence",
|
92: "illegal byte sequence",
|
||||||
36: "operation now in progress",
|
36: "operation now in progress",
|
||||||
4: "interrupted system call",
|
4: "interrupted system call",
|
||||||
22: "invalid argument",
|
22: "invalid argument",
|
||||||
5: "input/output error",
|
5: "input/output error",
|
||||||
56: "socket is already connected",
|
56: "socket is already connected",
|
||||||
21: "is a directory",
|
21: "is a directory",
|
||||||
103: "policy not found",
|
103: "policy not found",
|
||||||
62: "too many levels of symbolic links",
|
62: "too many levels of symbolic links",
|
||||||
24: "too many open files",
|
24: "too many open files",
|
||||||
31: "too many links",
|
31: "too many links",
|
||||||
40: "message too long",
|
40: "message too long",
|
||||||
95: "EMULTIHOP (Reserved)",
|
95: "EMULTIHOP (Reserved)",
|
||||||
63: "file name too long",
|
63: "file name too long",
|
||||||
81: "need authenticator",
|
81: "need authenticator",
|
||||||
50: "network is down",
|
50: "network is down",
|
||||||
52: "network dropped connection on reset",
|
52: "network dropped connection on reset",
|
||||||
51: "network is unreachable",
|
51: "network is unreachable",
|
||||||
23: "too many open files in system",
|
23: "too many open files in system",
|
||||||
93: "attribute not found",
|
93: "attribute not found",
|
||||||
55: "no buffer space available",
|
55: "no buffer space available",
|
||||||
96: "no message available on STREAM",
|
96: "no message available on STREAM",
|
||||||
19: "operation not supported by device",
|
19: "operation not supported by device",
|
||||||
2: "no such file or directory",
|
2: "no such file or directory",
|
||||||
8: "exec format error",
|
8: "exec format error",
|
||||||
77: "no locks available",
|
77: "no locks available",
|
||||||
97: "ENOLINK (Reserved)",
|
97: "ENOLINK (Reserved)",
|
||||||
12: "cannot allocate memory",
|
12: "cannot allocate memory",
|
||||||
91: "no message of desired type",
|
91: "no message of desired type",
|
||||||
42: "protocol not available",
|
42: "protocol not available",
|
||||||
28: "no space left on device",
|
28: "no space left on device",
|
||||||
98: "no STREAM resources",
|
98: "no STREAM resources",
|
||||||
99: "not a STREAM",
|
99: "not a STREAM",
|
||||||
78: "function not implemented",
|
78: "function not implemented",
|
||||||
15: "block device required",
|
15: "block device required",
|
||||||
57: "socket is not connected",
|
57: "socket is not connected",
|
||||||
20: "not a directory",
|
20: "not a directory",
|
||||||
66: "directory not empty",
|
66: "directory not empty",
|
||||||
38: "socket operation on non-socket",
|
38: "socket operation on non-socket",
|
||||||
45: "operation not supported",
|
45: "operation not supported",
|
||||||
25: "inappropriate ioctl for device",
|
25: "inappropriate ioctl for device",
|
||||||
6: "device not configured",
|
6: "device not configured",
|
||||||
102: "operation not supported on socket",
|
102: "operation not supported on socket",
|
||||||
84: "value too large to be stored in data type",
|
84: "value too large to be stored in data type",
|
||||||
1: "operation not permitted",
|
1: "operation not permitted",
|
||||||
46: "protocol family not supported",
|
46: "protocol family not supported",
|
||||||
32: "broken pipe",
|
32: "broken pipe",
|
||||||
67: "too many processes",
|
67: "too many processes",
|
||||||
76: "bad procedure for program",
|
76: "bad procedure for program",
|
||||||
75: "program version wrong",
|
75: "program version wrong",
|
||||||
74: "RPC prog. not avail",
|
74: "RPC prog. not avail",
|
||||||
100: "protocol error",
|
100: "protocol error",
|
||||||
43: "protocol not supported",
|
43: "protocol not supported",
|
||||||
41: "protocol wrong type for socket",
|
41: "protocol wrong type for socket",
|
||||||
82: "device power is off",
|
82: "device power is off",
|
||||||
34: "result too large",
|
34: "result too large",
|
||||||
71: "too many levels of remote in path",
|
71: "too many levels of remote in path",
|
||||||
30: "read-only file system",
|
30: "read-only file system",
|
||||||
73: "RPC version wrong",
|
73: "RPC version wrong",
|
||||||
87: "shared library version mismatch",
|
87: "shared library version mismatch",
|
||||||
58: "can't send after socket shutdown",
|
58: "can't send after socket shutdown",
|
||||||
44: "socket type not supported",
|
44: "socket type not supported",
|
||||||
29: "illegal seek",
|
29: "illegal seek",
|
||||||
3: "no such process",
|
3: "no such process",
|
||||||
70: "stale NFS file handle",
|
70: "stale NFS file handle",
|
||||||
101: "STREAM ioctl timeout",
|
101: "STREAM ioctl timeout",
|
||||||
60: "operation timed out",
|
60: "operation timed out",
|
||||||
59: "too many references: can't splice",
|
59: "too many references: can't splice",
|
||||||
26: "text file busy",
|
26: "text file busy",
|
||||||
68: "too many users",
|
68: "too many users",
|
||||||
18: "cross-device link",
|
18: "cross-device link",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -535,107 +535,107 @@ const (
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errors = [...]string{
|
||||||
7: "argument list too long",
|
7: "argument list too long",
|
||||||
13: "permission denied",
|
13: "permission denied",
|
||||||
48: "address already in use",
|
48: "address already in use",
|
||||||
49: "can't assign requested address",
|
49: "can't assign requested address",
|
||||||
47: "address family not supported by protocol family",
|
47: "address family not supported by protocol family",
|
||||||
35: "resource temporarily unavailable",
|
35: "resource temporarily unavailable",
|
||||||
37: "operation already in progress",
|
37: "operation already in progress",
|
||||||
80: "authentication error",
|
80: "authentication error",
|
||||||
86: "bad CPU type in executable",
|
86: "bad CPU type in executable",
|
||||||
85: "bad executable (or shared library)",
|
85: "bad executable (or shared library)",
|
||||||
9: "bad file descriptor",
|
9: "bad file descriptor",
|
||||||
88: "malformed Mach-o file",
|
88: "malformed Mach-o file",
|
||||||
94: "bad message",
|
94: "bad message",
|
||||||
72: "RPC struct is bad",
|
72: "RPC struct is bad",
|
||||||
16: "resource busy",
|
16: "resource busy",
|
||||||
89: "operation canceled",
|
89: "operation canceled",
|
||||||
10: "no child processes",
|
10: "no child processes",
|
||||||
53: "software caused connection abort",
|
53: "software caused connection abort",
|
||||||
61: "connection refused",
|
61: "connection refused",
|
||||||
54: "connection reset by peer",
|
54: "connection reset by peer",
|
||||||
11: "resource deadlock avoided",
|
11: "resource deadlock avoided",
|
||||||
39: "destination address required",
|
39: "destination address required",
|
||||||
83: "device error",
|
83: "device error",
|
||||||
33: "numerical argument out of domain",
|
33: "numerical argument out of domain",
|
||||||
69: "disc quota exceeded",
|
69: "disc quota exceeded",
|
||||||
17: "file exists",
|
17: "file exists",
|
||||||
14: "bad address",
|
14: "bad address",
|
||||||
27: "file too large",
|
27: "file too large",
|
||||||
79: "inappropriate file type or format",
|
79: "inappropriate file type or format",
|
||||||
64: "host is down",
|
64: "host is down",
|
||||||
65: "no route to host",
|
65: "no route to host",
|
||||||
90: "identifier removed",
|
90: "identifier removed",
|
||||||
92: "illegal byte sequence",
|
92: "illegal byte sequence",
|
||||||
36: "operation now in progress",
|
36: "operation now in progress",
|
||||||
4: "interrupted system call",
|
4: "interrupted system call",
|
||||||
22: "invalid argument",
|
22: "invalid argument",
|
||||||
5: "input/output error",
|
5: "input/output error",
|
||||||
56: "socket is already connected",
|
56: "socket is already connected",
|
||||||
21: "is a directory",
|
21: "is a directory",
|
||||||
103: "policy not found",
|
103: "policy not found",
|
||||||
62: "too many levels of symbolic links",
|
62: "too many levels of symbolic links",
|
||||||
24: "too many open files",
|
24: "too many open files",
|
||||||
31: "too many links",
|
31: "too many links",
|
||||||
40: "message too long",
|
40: "message too long",
|
||||||
95: "EMULTIHOP (Reserved)",
|
95: "EMULTIHOP (Reserved)",
|
||||||
63: "file name too long",
|
63: "file name too long",
|
||||||
81: "need authenticator",
|
81: "need authenticator",
|
||||||
50: "network is down",
|
50: "network is down",
|
||||||
52: "network dropped connection on reset",
|
52: "network dropped connection on reset",
|
||||||
51: "network is unreachable",
|
51: "network is unreachable",
|
||||||
23: "too many open files in system",
|
23: "too many open files in system",
|
||||||
93: "attribute not found",
|
93: "attribute not found",
|
||||||
55: "no buffer space available",
|
55: "no buffer space available",
|
||||||
96: "no message available on STREAM",
|
96: "no message available on STREAM",
|
||||||
19: "operation not supported by device",
|
19: "operation not supported by device",
|
||||||
2: "no such file or directory",
|
2: "no such file or directory",
|
||||||
8: "exec format error",
|
8: "exec format error",
|
||||||
77: "no locks available",
|
77: "no locks available",
|
||||||
97: "ENOLINK (Reserved)",
|
97: "ENOLINK (Reserved)",
|
||||||
12: "cannot allocate memory",
|
12: "cannot allocate memory",
|
||||||
91: "no message of desired type",
|
91: "no message of desired type",
|
||||||
42: "protocol not available",
|
42: "protocol not available",
|
||||||
28: "no space left on device",
|
28: "no space left on device",
|
||||||
98: "no STREAM resources",
|
98: "no STREAM resources",
|
||||||
99: "not a STREAM",
|
99: "not a STREAM",
|
||||||
78: "function not implemented",
|
78: "function not implemented",
|
||||||
15: "block device required",
|
15: "block device required",
|
||||||
57: "socket is not connected",
|
57: "socket is not connected",
|
||||||
20: "not a directory",
|
20: "not a directory",
|
||||||
66: "directory not empty",
|
66: "directory not empty",
|
||||||
38: "socket operation on non-socket",
|
38: "socket operation on non-socket",
|
||||||
45: "operation not supported",
|
45: "operation not supported",
|
||||||
25: "inappropriate ioctl for device",
|
25: "inappropriate ioctl for device",
|
||||||
6: "device not configured",
|
6: "device not configured",
|
||||||
102: "operation not supported on socket",
|
102: "operation not supported on socket",
|
||||||
84: "value too large to be stored in data type",
|
84: "value too large to be stored in data type",
|
||||||
1: "operation not permitted",
|
1: "operation not permitted",
|
||||||
46: "protocol family not supported",
|
46: "protocol family not supported",
|
||||||
32: "broken pipe",
|
32: "broken pipe",
|
||||||
67: "too many processes",
|
67: "too many processes",
|
||||||
76: "bad procedure for program",
|
76: "bad procedure for program",
|
||||||
75: "program version wrong",
|
75: "program version wrong",
|
||||||
74: "RPC prog. not avail",
|
74: "RPC prog. not avail",
|
||||||
100: "protocol error",
|
100: "protocol error",
|
||||||
43: "protocol not supported",
|
43: "protocol not supported",
|
||||||
41: "protocol wrong type for socket",
|
41: "protocol wrong type for socket",
|
||||||
82: "device power is off",
|
82: "device power is off",
|
||||||
34: "result too large",
|
34: "result too large",
|
||||||
71: "too many levels of remote in path",
|
71: "too many levels of remote in path",
|
||||||
30: "read-only file system",
|
30: "read-only file system",
|
||||||
73: "RPC version wrong",
|
73: "RPC version wrong",
|
||||||
87: "shared library version mismatch",
|
87: "shared library version mismatch",
|
||||||
58: "can't send after socket shutdown",
|
58: "can't send after socket shutdown",
|
||||||
44: "socket type not supported",
|
44: "socket type not supported",
|
||||||
29: "illegal seek",
|
29: "illegal seek",
|
||||||
3: "no such process",
|
3: "no such process",
|
||||||
70: "stale NFS file handle",
|
70: "stale NFS file handle",
|
||||||
101: "STREAM ioctl timeout",
|
101: "STREAM ioctl timeout",
|
||||||
60: "operation timed out",
|
60: "operation timed out",
|
||||||
59: "too many references: can't splice",
|
59: "too many references: can't splice",
|
||||||
26: "text file busy",
|
26: "text file busy",
|
||||||
68: "too many users",
|
68: "too many users",
|
||||||
18: "cross-device link",
|
18: "cross-device link",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -536,7 +536,7 @@ const (
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errors = [...]string{
|
||||||
7: "argument list too long",
|
7: "argument list too long",
|
||||||
13: "permission denied",
|
13: "permission denied",
|
||||||
48: "address already in use",
|
48: "address already in use",
|
||||||
49: "can't assign requested address",
|
49: "can't assign requested address",
|
||||||
|
|
@ -544,7 +544,7 @@ var errors = [...]string{
|
||||||
35: "resource temporarily unavailable",
|
35: "resource temporarily unavailable",
|
||||||
37: "operation already in progress",
|
37: "operation already in progress",
|
||||||
80: "authentication error",
|
80: "authentication error",
|
||||||
9: "bad file descriptor",
|
9: "bad file descriptor",
|
||||||
89: "bad message",
|
89: "bad message",
|
||||||
72: "RPC struct is bad",
|
72: "RPC struct is bad",
|
||||||
16: "device busy",
|
16: "device busy",
|
||||||
|
|
@ -567,9 +567,9 @@ var errors = [...]string{
|
||||||
82: "identifier removed",
|
82: "identifier removed",
|
||||||
86: "illegal byte sequence",
|
86: "illegal byte sequence",
|
||||||
36: "operation now in progress",
|
36: "operation now in progress",
|
||||||
4: "interrupted system call",
|
4: "interrupted system call",
|
||||||
22: "invalid argument",
|
22: "invalid argument",
|
||||||
5: "input/output error",
|
5: "input/output error",
|
||||||
56: "socket is already connected",
|
56: "socket is already connected",
|
||||||
21: "is a directory",
|
21: "is a directory",
|
||||||
92: "protocol error",
|
92: "protocol error",
|
||||||
|
|
@ -587,8 +587,8 @@ var errors = [...]string{
|
||||||
87: "attribute not found",
|
87: "attribute not found",
|
||||||
55: "no buffer space available",
|
55: "no buffer space available",
|
||||||
19: "operation not supported by device",
|
19: "operation not supported by device",
|
||||||
2: "no such file or directory",
|
2: "no such file or directory",
|
||||||
8: "exec format error",
|
8: "exec format error",
|
||||||
77: "no locks available",
|
77: "no locks available",
|
||||||
91: "link has been severed",
|
91: "link has been severed",
|
||||||
12: "cannot allocate memory",
|
12: "cannot allocate memory",
|
||||||
|
|
@ -603,9 +603,9 @@ var errors = [...]string{
|
||||||
38: "socket operation on non-socket",
|
38: "socket operation on non-socket",
|
||||||
45: "operation not supported",
|
45: "operation not supported",
|
||||||
25: "inappropriate ioctl for device",
|
25: "inappropriate ioctl for device",
|
||||||
6: "device not configured",
|
6: "device not configured",
|
||||||
84: "value too large to be stored in data type",
|
84: "value too large to be stored in data type",
|
||||||
1: "operation not permitted",
|
1: "operation not permitted",
|
||||||
46: "protocol family not supported",
|
46: "protocol family not supported",
|
||||||
32: "broken pipe",
|
32: "broken pipe",
|
||||||
67: "too many processes",
|
67: "too many processes",
|
||||||
|
|
@ -621,7 +621,7 @@ var errors = [...]string{
|
||||||
58: "can't send after socket shutdown",
|
58: "can't send after socket shutdown",
|
||||||
44: "socket type not supported",
|
44: "socket type not supported",
|
||||||
29: "illegal seek",
|
29: "illegal seek",
|
||||||
3: "no such process",
|
3: "no such process",
|
||||||
70: "stale NFS file handle",
|
70: "stale NFS file handle",
|
||||||
60: "operation timed out",
|
60: "operation timed out",
|
||||||
59: "too many references: can't splice",
|
59: "too many references: can't splice",
|
||||||
|
|
|
||||||
|
|
@ -536,7 +536,7 @@ const (
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errors = [...]string{
|
||||||
7: "argument list too long",
|
7: "argument list too long",
|
||||||
13: "permission denied",
|
13: "permission denied",
|
||||||
48: "address already in use",
|
48: "address already in use",
|
||||||
49: "can't assign requested address",
|
49: "can't assign requested address",
|
||||||
|
|
@ -544,7 +544,7 @@ var errors = [...]string{
|
||||||
35: "resource temporarily unavailable",
|
35: "resource temporarily unavailable",
|
||||||
37: "operation already in progress",
|
37: "operation already in progress",
|
||||||
80: "authentication error",
|
80: "authentication error",
|
||||||
9: "bad file descriptor",
|
9: "bad file descriptor",
|
||||||
89: "bad message",
|
89: "bad message",
|
||||||
72: "RPC struct is bad",
|
72: "RPC struct is bad",
|
||||||
16: "device busy",
|
16: "device busy",
|
||||||
|
|
@ -567,9 +567,9 @@ var errors = [...]string{
|
||||||
82: "identifier removed",
|
82: "identifier removed",
|
||||||
86: "illegal byte sequence",
|
86: "illegal byte sequence",
|
||||||
36: "operation now in progress",
|
36: "operation now in progress",
|
||||||
4: "interrupted system call",
|
4: "interrupted system call",
|
||||||
22: "invalid argument",
|
22: "invalid argument",
|
||||||
5: "input/output error",
|
5: "input/output error",
|
||||||
56: "socket is already connected",
|
56: "socket is already connected",
|
||||||
21: "is a directory",
|
21: "is a directory",
|
||||||
92: "protocol error",
|
92: "protocol error",
|
||||||
|
|
@ -587,8 +587,8 @@ var errors = [...]string{
|
||||||
87: "attribute not found",
|
87: "attribute not found",
|
||||||
55: "no buffer space available",
|
55: "no buffer space available",
|
||||||
19: "operation not supported by device",
|
19: "operation not supported by device",
|
||||||
2: "no such file or directory",
|
2: "no such file or directory",
|
||||||
8: "exec format error",
|
8: "exec format error",
|
||||||
77: "no locks available",
|
77: "no locks available",
|
||||||
91: "link has been severed",
|
91: "link has been severed",
|
||||||
12: "cannot allocate memory",
|
12: "cannot allocate memory",
|
||||||
|
|
@ -603,9 +603,9 @@ var errors = [...]string{
|
||||||
38: "socket operation on non-socket",
|
38: "socket operation on non-socket",
|
||||||
45: "operation not supported",
|
45: "operation not supported",
|
||||||
25: "inappropriate ioctl for device",
|
25: "inappropriate ioctl for device",
|
||||||
6: "device not configured",
|
6: "device not configured",
|
||||||
84: "value too large to be stored in data type",
|
84: "value too large to be stored in data type",
|
||||||
1: "operation not permitted",
|
1: "operation not permitted",
|
||||||
46: "protocol family not supported",
|
46: "protocol family not supported",
|
||||||
32: "broken pipe",
|
32: "broken pipe",
|
||||||
67: "too many processes",
|
67: "too many processes",
|
||||||
|
|
@ -621,7 +621,7 @@ var errors = [...]string{
|
||||||
58: "can't send after socket shutdown",
|
58: "can't send after socket shutdown",
|
||||||
44: "socket type not supported",
|
44: "socket type not supported",
|
||||||
29: "illegal seek",
|
29: "illegal seek",
|
||||||
3: "no such process",
|
3: "no such process",
|
||||||
70: "stale NFS file handle",
|
70: "stale NFS file handle",
|
||||||
60: "operation timed out",
|
60: "operation timed out",
|
||||||
59: "too many references: can't splice",
|
59: "too many references: can't splice",
|
||||||
|
|
|
||||||
|
|
@ -526,134 +526,134 @@ const (
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errors = [...]string{
|
||||||
7: "argument list too long",
|
7: "argument list too long",
|
||||||
13: "permission denied",
|
13: "permission denied",
|
||||||
98: "address already in use",
|
98: "address already in use",
|
||||||
99: "cannot assign requested address",
|
99: "cannot assign requested address",
|
||||||
68: "advertise error",
|
68: "advertise error",
|
||||||
97: "address family not supported by protocol",
|
97: "address family not supported by protocol",
|
||||||
11: "resource temporarily unavailable",
|
11: "resource temporarily unavailable",
|
||||||
114: "operation already in progress",
|
114: "operation already in progress",
|
||||||
52: "invalid exchange",
|
52: "invalid exchange",
|
||||||
9: "bad file descriptor",
|
9: "bad file descriptor",
|
||||||
77: "file descriptor in bad state",
|
77: "file descriptor in bad state",
|
||||||
74: "bad message",
|
74: "bad message",
|
||||||
53: "invalid request descriptor",
|
53: "invalid request descriptor",
|
||||||
56: "invalid request code",
|
56: "invalid request code",
|
||||||
57: "invalid slot",
|
57: "invalid slot",
|
||||||
59: "bad font file format",
|
59: "bad font file format",
|
||||||
16: "device or resource busy",
|
16: "device or resource busy",
|
||||||
125: "operation canceled",
|
125: "operation canceled",
|
||||||
10: "no child processes",
|
10: "no child processes",
|
||||||
44: "channel number out of range",
|
44: "channel number out of range",
|
||||||
70: "communication error on send",
|
70: "communication error on send",
|
||||||
103: "software caused connection abort",
|
103: "software caused connection abort",
|
||||||
111: "connection refused",
|
111: "connection refused",
|
||||||
104: "connection reset by peer",
|
104: "connection reset by peer",
|
||||||
35: "resource deadlock avoided",
|
35: "resource deadlock avoided",
|
||||||
89: "destination address required",
|
89: "destination address required",
|
||||||
33: "numerical argument out of domain",
|
33: "numerical argument out of domain",
|
||||||
73: "RFS specific error",
|
73: "RFS specific error",
|
||||||
122: "disk quota exceeded",
|
122: "disk quota exceeded",
|
||||||
17: "file exists",
|
17: "file exists",
|
||||||
14: "bad address",
|
14: "bad address",
|
||||||
27: "file too large",
|
27: "file too large",
|
||||||
112: "host is down",
|
112: "host is down",
|
||||||
113: "no route to host",
|
113: "no route to host",
|
||||||
43: "identifier removed",
|
43: "identifier removed",
|
||||||
84: "invalid or incomplete multibyte or wide character",
|
84: "invalid or incomplete multibyte or wide character",
|
||||||
115: "operation now in progress",
|
115: "operation now in progress",
|
||||||
4: "interrupted system call",
|
4: "interrupted system call",
|
||||||
22: "invalid argument",
|
22: "invalid argument",
|
||||||
5: "input/output error",
|
5: "input/output error",
|
||||||
106: "transport endpoint is already connected",
|
106: "transport endpoint is already connected",
|
||||||
21: "is a directory",
|
21: "is a directory",
|
||||||
120: "is a named type file",
|
120: "is a named type file",
|
||||||
127: "key has expired",
|
127: "key has expired",
|
||||||
129: "key was rejected by service",
|
129: "key was rejected by service",
|
||||||
128: "key has been revoked",
|
128: "key has been revoked",
|
||||||
51: "level 2 halted",
|
51: "level 2 halted",
|
||||||
45: "level 2 not synchronized",
|
45: "level 2 not synchronized",
|
||||||
46: "level 3 halted",
|
46: "level 3 halted",
|
||||||
47: "level 3 reset",
|
47: "level 3 reset",
|
||||||
79: "can not access a needed shared library",
|
79: "can not access a needed shared library",
|
||||||
80: "accessing a corrupted shared library",
|
80: "accessing a corrupted shared library",
|
||||||
83: "cannot exec a shared library directly",
|
83: "cannot exec a shared library directly",
|
||||||
82: "attempting to link in too many shared libraries",
|
82: "attempting to link in too many shared libraries",
|
||||||
81: ".lib section in a.out corrupted",
|
81: ".lib section in a.out corrupted",
|
||||||
48: "link number out of range",
|
48: "link number out of range",
|
||||||
40: "too many levels of symbolic links",
|
40: "too many levels of symbolic links",
|
||||||
124: "wrong medium type",
|
124: "wrong medium type",
|
||||||
24: "too many open files",
|
24: "too many open files",
|
||||||
31: "too many links",
|
31: "too many links",
|
||||||
90: "message too long",
|
90: "message too long",
|
||||||
72: "multihop attempted",
|
72: "multihop attempted",
|
||||||
36: "file name too long",
|
36: "file name too long",
|
||||||
119: "no XENIX semaphores available",
|
119: "no XENIX semaphores available",
|
||||||
100: "network is down",
|
100: "network is down",
|
||||||
102: "network dropped connection on reset",
|
102: "network dropped connection on reset",
|
||||||
101: "network is unreachable",
|
101: "network is unreachable",
|
||||||
23: "too many open files in system",
|
23: "too many open files in system",
|
||||||
55: "no anode",
|
55: "no anode",
|
||||||
105: "no buffer space available",
|
105: "no buffer space available",
|
||||||
50: "no CSI structure available",
|
50: "no CSI structure available",
|
||||||
61: "no data available",
|
61: "no data available",
|
||||||
19: "no such device",
|
19: "no such device",
|
||||||
2: "no such file or directory",
|
2: "no such file or directory",
|
||||||
8: "exec format error",
|
8: "exec format error",
|
||||||
126: "required key not available",
|
126: "required key not available",
|
||||||
37: "no locks available",
|
37: "no locks available",
|
||||||
67: "link has been severed",
|
67: "link has been severed",
|
||||||
123: "no medium found",
|
123: "no medium found",
|
||||||
12: "cannot allocate memory",
|
12: "cannot allocate memory",
|
||||||
42: "no message of desired type",
|
42: "no message of desired type",
|
||||||
64: "machine is not on the network",
|
64: "machine is not on the network",
|
||||||
65: "package not installed",
|
65: "package not installed",
|
||||||
92: "protocol not available",
|
92: "protocol not available",
|
||||||
28: "no space left on device",
|
28: "no space left on device",
|
||||||
63: "out of streams resources",
|
63: "out of streams resources",
|
||||||
60: "device not a stream",
|
60: "device not a stream",
|
||||||
38: "function not implemented",
|
38: "function not implemented",
|
||||||
15: "block device required",
|
15: "block device required",
|
||||||
107: "transport endpoint is not connected",
|
107: "transport endpoint is not connected",
|
||||||
20: "not a directory",
|
20: "not a directory",
|
||||||
39: "directory not empty",
|
39: "directory not empty",
|
||||||
118: "not a XENIX named type file",
|
118: "not a XENIX named type file",
|
||||||
131: "state not recoverable",
|
131: "state not recoverable",
|
||||||
88: "socket operation on non-socket",
|
88: "socket operation on non-socket",
|
||||||
95: "operation not supported",
|
95: "operation not supported",
|
||||||
25: "inappropriate ioctl for device",
|
25: "inappropriate ioctl for device",
|
||||||
76: "name not unique on network",
|
76: "name not unique on network",
|
||||||
6: "no such device or address",
|
6: "no such device or address",
|
||||||
75: "value too large for defined data type",
|
75: "value too large for defined data type",
|
||||||
130: "owner died",
|
130: "owner died",
|
||||||
1: "operation not permitted",
|
1: "operation not permitted",
|
||||||
96: "protocol family not supported",
|
96: "protocol family not supported",
|
||||||
32: "broken pipe",
|
32: "broken pipe",
|
||||||
71: "protocol error",
|
71: "protocol error",
|
||||||
93: "protocol not supported",
|
93: "protocol not supported",
|
||||||
91: "protocol wrong type for socket",
|
91: "protocol wrong type for socket",
|
||||||
34: "numerical result out of range",
|
34: "numerical result out of range",
|
||||||
78: "remote address changed",
|
78: "remote address changed",
|
||||||
66: "object is remote",
|
66: "object is remote",
|
||||||
121: "remote I/O error",
|
121: "remote I/O error",
|
||||||
85: "interrupted system call should be restarted",
|
85: "interrupted system call should be restarted",
|
||||||
132: "unknown error 132",
|
132: "unknown error 132",
|
||||||
30: "read-only file system",
|
30: "read-only file system",
|
||||||
108: "cannot send after transport endpoint shutdown",
|
108: "cannot send after transport endpoint shutdown",
|
||||||
94: "socket type not supported",
|
94: "socket type not supported",
|
||||||
29: "illegal seek",
|
29: "illegal seek",
|
||||||
3: "no such process",
|
3: "no such process",
|
||||||
69: "srmount error",
|
69: "srmount error",
|
||||||
116: "stale NFS file handle",
|
116: "stale NFS file handle",
|
||||||
86: "streams pipe error",
|
86: "streams pipe error",
|
||||||
62: "timer expired",
|
62: "timer expired",
|
||||||
110: "connection timed out",
|
110: "connection timed out",
|
||||||
109: "too many references: cannot splice",
|
109: "too many references: cannot splice",
|
||||||
26: "text file busy",
|
26: "text file busy",
|
||||||
117: "structure needs cleaning",
|
117: "structure needs cleaning",
|
||||||
49: "protocol driver not attached",
|
49: "protocol driver not attached",
|
||||||
87: "too many users",
|
87: "too many users",
|
||||||
18: "invalid cross-device link",
|
18: "invalid cross-device link",
|
||||||
54: "exchange full",
|
54: "exchange full",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -526,134 +526,134 @@ const (
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errors = [...]string{
|
||||||
7: "argument list too long",
|
7: "argument list too long",
|
||||||
13: "permission denied",
|
13: "permission denied",
|
||||||
98: "address already in use",
|
98: "address already in use",
|
||||||
99: "cannot assign requested address",
|
99: "cannot assign requested address",
|
||||||
68: "advertise error",
|
68: "advertise error",
|
||||||
97: "address family not supported by protocol",
|
97: "address family not supported by protocol",
|
||||||
11: "resource temporarily unavailable",
|
11: "resource temporarily unavailable",
|
||||||
114: "operation already in progress",
|
114: "operation already in progress",
|
||||||
52: "invalid exchange",
|
52: "invalid exchange",
|
||||||
9: "bad file descriptor",
|
9: "bad file descriptor",
|
||||||
77: "file descriptor in bad state",
|
77: "file descriptor in bad state",
|
||||||
74: "bad message",
|
74: "bad message",
|
||||||
53: "invalid request descriptor",
|
53: "invalid request descriptor",
|
||||||
56: "invalid request code",
|
56: "invalid request code",
|
||||||
57: "invalid slot",
|
57: "invalid slot",
|
||||||
59: "bad font file format",
|
59: "bad font file format",
|
||||||
16: "device or resource busy",
|
16: "device or resource busy",
|
||||||
125: "operation canceled",
|
125: "operation canceled",
|
||||||
10: "no child processes",
|
10: "no child processes",
|
||||||
44: "channel number out of range",
|
44: "channel number out of range",
|
||||||
70: "communication error on send",
|
70: "communication error on send",
|
||||||
103: "software caused connection abort",
|
103: "software caused connection abort",
|
||||||
111: "connection refused",
|
111: "connection refused",
|
||||||
104: "connection reset by peer",
|
104: "connection reset by peer",
|
||||||
35: "resource deadlock avoided",
|
35: "resource deadlock avoided",
|
||||||
89: "destination address required",
|
89: "destination address required",
|
||||||
33: "numerical argument out of domain",
|
33: "numerical argument out of domain",
|
||||||
73: "RFS specific error",
|
73: "RFS specific error",
|
||||||
122: "disk quota exceeded",
|
122: "disk quota exceeded",
|
||||||
17: "file exists",
|
17: "file exists",
|
||||||
14: "bad address",
|
14: "bad address",
|
||||||
27: "file too large",
|
27: "file too large",
|
||||||
112: "host is down",
|
112: "host is down",
|
||||||
113: "no route to host",
|
113: "no route to host",
|
||||||
43: "identifier removed",
|
43: "identifier removed",
|
||||||
84: "invalid or incomplete multibyte or wide character",
|
84: "invalid or incomplete multibyte or wide character",
|
||||||
115: "operation now in progress",
|
115: "operation now in progress",
|
||||||
4: "interrupted system call",
|
4: "interrupted system call",
|
||||||
22: "invalid argument",
|
22: "invalid argument",
|
||||||
5: "input/output error",
|
5: "input/output error",
|
||||||
106: "transport endpoint is already connected",
|
106: "transport endpoint is already connected",
|
||||||
21: "is a directory",
|
21: "is a directory",
|
||||||
120: "is a named type file",
|
120: "is a named type file",
|
||||||
127: "key has expired",
|
127: "key has expired",
|
||||||
129: "key was rejected by service",
|
129: "key was rejected by service",
|
||||||
128: "key has been revoked",
|
128: "key has been revoked",
|
||||||
51: "level 2 halted",
|
51: "level 2 halted",
|
||||||
45: "level 2 not synchronized",
|
45: "level 2 not synchronized",
|
||||||
46: "level 3 halted",
|
46: "level 3 halted",
|
||||||
47: "level 3 reset",
|
47: "level 3 reset",
|
||||||
79: "can not access a needed shared library",
|
79: "can not access a needed shared library",
|
||||||
80: "accessing a corrupted shared library",
|
80: "accessing a corrupted shared library",
|
||||||
83: "cannot exec a shared library directly",
|
83: "cannot exec a shared library directly",
|
||||||
82: "attempting to link in too many shared libraries",
|
82: "attempting to link in too many shared libraries",
|
||||||
81: ".lib section in a.out corrupted",
|
81: ".lib section in a.out corrupted",
|
||||||
48: "link number out of range",
|
48: "link number out of range",
|
||||||
40: "too many levels of symbolic links",
|
40: "too many levels of symbolic links",
|
||||||
124: "wrong medium type",
|
124: "wrong medium type",
|
||||||
24: "too many open files",
|
24: "too many open files",
|
||||||
31: "too many links",
|
31: "too many links",
|
||||||
90: "message too long",
|
90: "message too long",
|
||||||
72: "multihop attempted",
|
72: "multihop attempted",
|
||||||
36: "file name too long",
|
36: "file name too long",
|
||||||
119: "no XENIX semaphores available",
|
119: "no XENIX semaphores available",
|
||||||
100: "network is down",
|
100: "network is down",
|
||||||
102: "network dropped connection on reset",
|
102: "network dropped connection on reset",
|
||||||
101: "network is unreachable",
|
101: "network is unreachable",
|
||||||
23: "too many open files in system",
|
23: "too many open files in system",
|
||||||
55: "no anode",
|
55: "no anode",
|
||||||
105: "no buffer space available",
|
105: "no buffer space available",
|
||||||
50: "no CSI structure available",
|
50: "no CSI structure available",
|
||||||
61: "no data available",
|
61: "no data available",
|
||||||
19: "no such device",
|
19: "no such device",
|
||||||
2: "no such file or directory",
|
2: "no such file or directory",
|
||||||
8: "exec format error",
|
8: "exec format error",
|
||||||
126: "required key not available",
|
126: "required key not available",
|
||||||
37: "no locks available",
|
37: "no locks available",
|
||||||
67: "link has been severed",
|
67: "link has been severed",
|
||||||
123: "no medium found",
|
123: "no medium found",
|
||||||
12: "cannot allocate memory",
|
12: "cannot allocate memory",
|
||||||
42: "no message of desired type",
|
42: "no message of desired type",
|
||||||
64: "machine is not on the network",
|
64: "machine is not on the network",
|
||||||
65: "package not installed",
|
65: "package not installed",
|
||||||
92: "protocol not available",
|
92: "protocol not available",
|
||||||
28: "no space left on device",
|
28: "no space left on device",
|
||||||
63: "out of streams resources",
|
63: "out of streams resources",
|
||||||
60: "device not a stream",
|
60: "device not a stream",
|
||||||
38: "function not implemented",
|
38: "function not implemented",
|
||||||
15: "block device required",
|
15: "block device required",
|
||||||
107: "transport endpoint is not connected",
|
107: "transport endpoint is not connected",
|
||||||
20: "not a directory",
|
20: "not a directory",
|
||||||
39: "directory not empty",
|
39: "directory not empty",
|
||||||
118: "not a XENIX named type file",
|
118: "not a XENIX named type file",
|
||||||
131: "state not recoverable",
|
131: "state not recoverable",
|
||||||
88: "socket operation on non-socket",
|
88: "socket operation on non-socket",
|
||||||
95: "operation not supported",
|
95: "operation not supported",
|
||||||
25: "inappropriate ioctl for device",
|
25: "inappropriate ioctl for device",
|
||||||
76: "name not unique on network",
|
76: "name not unique on network",
|
||||||
6: "no such device or address",
|
6: "no such device or address",
|
||||||
75: "value too large for defined data type",
|
75: "value too large for defined data type",
|
||||||
130: "owner died",
|
130: "owner died",
|
||||||
1: "operation not permitted",
|
1: "operation not permitted",
|
||||||
96: "protocol family not supported",
|
96: "protocol family not supported",
|
||||||
32: "broken pipe",
|
32: "broken pipe",
|
||||||
71: "protocol error",
|
71: "protocol error",
|
||||||
93: "protocol not supported",
|
93: "protocol not supported",
|
||||||
91: "protocol wrong type for socket",
|
91: "protocol wrong type for socket",
|
||||||
34: "numerical result out of range",
|
34: "numerical result out of range",
|
||||||
78: "remote address changed",
|
78: "remote address changed",
|
||||||
66: "object is remote",
|
66: "object is remote",
|
||||||
121: "remote I/O error",
|
121: "remote I/O error",
|
||||||
85: "interrupted system call should be restarted",
|
85: "interrupted system call should be restarted",
|
||||||
132: "unknown error 132",
|
132: "unknown error 132",
|
||||||
30: "read-only file system",
|
30: "read-only file system",
|
||||||
108: "cannot send after transport endpoint shutdown",
|
108: "cannot send after transport endpoint shutdown",
|
||||||
94: "socket type not supported",
|
94: "socket type not supported",
|
||||||
29: "illegal seek",
|
29: "illegal seek",
|
||||||
3: "no such process",
|
3: "no such process",
|
||||||
69: "srmount error",
|
69: "srmount error",
|
||||||
116: "stale NFS file handle",
|
116: "stale NFS file handle",
|
||||||
86: "streams pipe error",
|
86: "streams pipe error",
|
||||||
62: "timer expired",
|
62: "timer expired",
|
||||||
110: "connection timed out",
|
110: "connection timed out",
|
||||||
109: "too many references: cannot splice",
|
109: "too many references: cannot splice",
|
||||||
26: "text file busy",
|
26: "text file busy",
|
||||||
117: "structure needs cleaning",
|
117: "structure needs cleaning",
|
||||||
49: "protocol driver not attached",
|
49: "protocol driver not attached",
|
||||||
87: "too many users",
|
87: "too many users",
|
||||||
18: "invalid cross-device link",
|
18: "invalid cross-device link",
|
||||||
54: "exchange full",
|
54: "exchange full",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -187,133 +187,133 @@ const (
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errors = [...]string{
|
||||||
72: "multihop attempted",
|
72: "multihop attempted",
|
||||||
49: "protocol driver not attached",
|
49: "protocol driver not attached",
|
||||||
97: "address family not supported by protocol",
|
97: "address family not supported by protocol",
|
||||||
78: "remote address changed",
|
78: "remote address changed",
|
||||||
13: "permission denied",
|
13: "permission denied",
|
||||||
47: "level 3 reset",
|
47: "level 3 reset",
|
||||||
89: "destination address required",
|
89: "destination address required",
|
||||||
84: "invalid or incomplete multibyte or wide character",
|
84: "invalid or incomplete multibyte or wide character",
|
||||||
29: "illegal seek",
|
29: "illegal seek",
|
||||||
31: "too many links",
|
31: "too many links",
|
||||||
130: "owner died",
|
130: "owner died",
|
||||||
25: "inappropriate ioctl for device",
|
25: "inappropriate ioctl for device",
|
||||||
52: "invalid exchange",
|
52: "invalid exchange",
|
||||||
9: "bad file descriptor",
|
9: "bad file descriptor",
|
||||||
53: "invalid request descriptor",
|
53: "invalid request descriptor",
|
||||||
68: "advertise error",
|
68: "advertise error",
|
||||||
34: "numerical result out of range",
|
34: "numerical result out of range",
|
||||||
125: "operation canceled",
|
125: "operation canceled",
|
||||||
26: "text file busy",
|
26: "text file busy",
|
||||||
12: "cannot allocate memory",
|
12: "cannot allocate memory",
|
||||||
115: "operation now in progress",
|
115: "operation now in progress",
|
||||||
39: "directory not empty",
|
39: "directory not empty",
|
||||||
15: "block device required",
|
15: "block device required",
|
||||||
91: "protocol wrong type for socket",
|
91: "protocol wrong type for socket",
|
||||||
85: "interrupted system call should be restarted",
|
85: "interrupted system call should be restarted",
|
||||||
120: "is a named type file",
|
120: "is a named type file",
|
||||||
42: "no message of desired type",
|
42: "no message of desired type",
|
||||||
114: "operation already in progress",
|
114: "operation already in progress",
|
||||||
110: "connection timed out",
|
110: "connection timed out",
|
||||||
61: "no data available",
|
61: "no data available",
|
||||||
4: "interrupted system call",
|
4: "interrupted system call",
|
||||||
67: "link has been severed",
|
67: "link has been severed",
|
||||||
1: "operation not permitted",
|
1: "operation not permitted",
|
||||||
40: "too many levels of symbolic links",
|
40: "too many levels of symbolic links",
|
||||||
100: "network is down",
|
100: "network is down",
|
||||||
116: "stale NFS file handle",
|
116: "stale NFS file handle",
|
||||||
88: "socket operation on non-socket",
|
88: "socket operation on non-socket",
|
||||||
63: "out of streams resources",
|
63: "out of streams resources",
|
||||||
10: "no child processes",
|
10: "no child processes",
|
||||||
48: "link number out of range",
|
48: "link number out of range",
|
||||||
32: "broken pipe",
|
32: "broken pipe",
|
||||||
74: "bad message",
|
74: "bad message",
|
||||||
59: "bad font file format",
|
59: "bad font file format",
|
||||||
66: "object is remote",
|
66: "object is remote",
|
||||||
109: "too many references: cannot splice",
|
109: "too many references: cannot splice",
|
||||||
96: "protocol family not supported",
|
96: "protocol family not supported",
|
||||||
64: "machine is not on the network",
|
64: "machine is not on the network",
|
||||||
54: "exchange full",
|
54: "exchange full",
|
||||||
57: "invalid slot",
|
57: "invalid slot",
|
||||||
118: "not a XENIX named type file",
|
118: "not a XENIX named type file",
|
||||||
50: "no CSI structure available",
|
50: "no CSI structure available",
|
||||||
98: "address already in use",
|
98: "address already in use",
|
||||||
102: "network dropped connection on reset",
|
102: "network dropped connection on reset",
|
||||||
21: "is a directory",
|
21: "is a directory",
|
||||||
43: "identifier removed",
|
43: "identifier removed",
|
||||||
70: "communication error on send",
|
70: "communication error on send",
|
||||||
77: "file descriptor in bad state",
|
77: "file descriptor in bad state",
|
||||||
51: "level 2 halted",
|
51: "level 2 halted",
|
||||||
126: "required key not available",
|
126: "required key not available",
|
||||||
22: "invalid argument",
|
22: "invalid argument",
|
||||||
108: "cannot send after transport endpoint shutdown",
|
108: "cannot send after transport endpoint shutdown",
|
||||||
129: "key was rejected by service",
|
129: "key was rejected by service",
|
||||||
81: ".lib section in a.out corrupted",
|
81: ".lib section in a.out corrupted",
|
||||||
119: "no XENIX semaphores available",
|
119: "no XENIX semaphores available",
|
||||||
75: "value too large for defined data type",
|
75: "value too large for defined data type",
|
||||||
117: "structure needs cleaning",
|
117: "structure needs cleaning",
|
||||||
123: "no medium found",
|
123: "no medium found",
|
||||||
16: "device or resource busy",
|
16: "device or resource busy",
|
||||||
71: "protocol error",
|
71: "protocol error",
|
||||||
19: "no such device",
|
19: "no such device",
|
||||||
127: "key has expired",
|
127: "key has expired",
|
||||||
30: "read-only file system",
|
30: "read-only file system",
|
||||||
79: "can not access a needed shared library",
|
79: "can not access a needed shared library",
|
||||||
7: "argument list too long",
|
7: "argument list too long",
|
||||||
35: "resource deadlock avoided",
|
35: "resource deadlock avoided",
|
||||||
20: "not a directory",
|
20: "not a directory",
|
||||||
104: "connection reset by peer",
|
104: "connection reset by peer",
|
||||||
6: "no such device or address",
|
6: "no such device or address",
|
||||||
56: "invalid request code",
|
56: "invalid request code",
|
||||||
36: "file name too long",
|
36: "file name too long",
|
||||||
94: "socket type not supported",
|
94: "socket type not supported",
|
||||||
83: "cannot exec a shared library directly",
|
83: "cannot exec a shared library directly",
|
||||||
73: "RFS specific error",
|
73: "RFS specific error",
|
||||||
99: "cannot assign requested address",
|
99: "cannot assign requested address",
|
||||||
62: "timer expired",
|
62: "timer expired",
|
||||||
93: "protocol not supported",
|
93: "protocol not supported",
|
||||||
131: "state not recoverable",
|
131: "state not recoverable",
|
||||||
5: "input/output error",
|
5: "input/output error",
|
||||||
101: "network is unreachable",
|
101: "network is unreachable",
|
||||||
18: "invalid cross-device link",
|
18: "invalid cross-device link",
|
||||||
122: "disk quota exceeded",
|
122: "disk quota exceeded",
|
||||||
121: "remote I/O error",
|
121: "remote I/O error",
|
||||||
28: "no space left on device",
|
28: "no space left on device",
|
||||||
8: "exec format error",
|
8: "exec format error",
|
||||||
90: "message too long",
|
90: "message too long",
|
||||||
33: "numerical argument out of domain",
|
33: "numerical argument out of domain",
|
||||||
60: "device not a stream",
|
60: "device not a stream",
|
||||||
27: "file too large",
|
27: "file too large",
|
||||||
3: "no such process",
|
3: "no such process",
|
||||||
44: "channel number out of range",
|
44: "channel number out of range",
|
||||||
112: "host is down",
|
112: "host is down",
|
||||||
37: "no locks available",
|
37: "no locks available",
|
||||||
23: "too many open files in system",
|
23: "too many open files in system",
|
||||||
38: "function not implemented",
|
38: "function not implemented",
|
||||||
107: "transport endpoint is not connected",
|
107: "transport endpoint is not connected",
|
||||||
95: "operation not supported",
|
95: "operation not supported",
|
||||||
69: "srmount error",
|
69: "srmount error",
|
||||||
103: "software caused connection abort",
|
103: "software caused connection abort",
|
||||||
55: "no anode",
|
55: "no anode",
|
||||||
106: "transport endpoint is already connected",
|
106: "transport endpoint is already connected",
|
||||||
87: "too many users",
|
87: "too many users",
|
||||||
92: "protocol not available",
|
92: "protocol not available",
|
||||||
24: "too many open files",
|
24: "too many open files",
|
||||||
105: "no buffer space available",
|
105: "no buffer space available",
|
||||||
46: "level 3 halted",
|
46: "level 3 halted",
|
||||||
14: "bad address",
|
14: "bad address",
|
||||||
11: "resource temporarily unavailable",
|
11: "resource temporarily unavailable",
|
||||||
80: "accessing a corrupted shared library",
|
80: "accessing a corrupted shared library",
|
||||||
86: "streams pipe error",
|
86: "streams pipe error",
|
||||||
111: "connection refused",
|
111: "connection refused",
|
||||||
82: "attempting to link in too many shared libraries",
|
82: "attempting to link in too many shared libraries",
|
||||||
17: "file exists",
|
17: "file exists",
|
||||||
45: "level 2 not synchronized",
|
45: "level 2 not synchronized",
|
||||||
2: "no such file or directory",
|
2: "no such file or directory",
|
||||||
65: "package not installed",
|
65: "package not installed",
|
||||||
128: "key has been revoked",
|
128: "key has been revoked",
|
||||||
113: "no route to host",
|
113: "no route to host",
|
||||||
76: "name not unique on network",
|
76: "name not unique on network",
|
||||||
124: "wrong medium type",
|
124: "wrong medium type",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,118 +129,118 @@ const (
|
||||||
|
|
||||||
// Error table
|
// Error table
|
||||||
var errors = [...]string{
|
var errors = [...]string{
|
||||||
EPERM: "operation not permitted",
|
EPERM: "operation not permitted",
|
||||||
ENOENT: "no such file or directory",
|
ENOENT: "no such file or directory",
|
||||||
ESRCH: "no such process",
|
ESRCH: "no such process",
|
||||||
EINTR: "interrupted system call",
|
EINTR: "interrupted system call",
|
||||||
EIO: "I/O error",
|
EIO: "I/O error",
|
||||||
ENXIO: "no such device or address",
|
ENXIO: "no such device or address",
|
||||||
E2BIG: "argument list too long",
|
E2BIG: "argument list too long",
|
||||||
ENOEXEC: "exec format error",
|
ENOEXEC: "exec format error",
|
||||||
EBADF: "bad file number",
|
EBADF: "bad file number",
|
||||||
ECHILD: "no child processes",
|
ECHILD: "no child processes",
|
||||||
EAGAIN: "try again",
|
EAGAIN: "try again",
|
||||||
ENOMEM: "out of memory",
|
ENOMEM: "out of memory",
|
||||||
EACCES: "permission denied",
|
EACCES: "permission denied",
|
||||||
EFAULT: "bad address",
|
EFAULT: "bad address",
|
||||||
EBUSY: "device or resource busy",
|
EBUSY: "device or resource busy",
|
||||||
EEXIST: "file exists",
|
EEXIST: "file exists",
|
||||||
EXDEV: "cross-device link",
|
EXDEV: "cross-device link",
|
||||||
ENODEV: "no such device",
|
ENODEV: "no such device",
|
||||||
ENOTDIR: "not a directory",
|
ENOTDIR: "not a directory",
|
||||||
EISDIR: "is a directory",
|
EISDIR: "is a directory",
|
||||||
EINVAL: "invalid argument",
|
EINVAL: "invalid argument",
|
||||||
ENFILE: "file table overflow",
|
ENFILE: "file table overflow",
|
||||||
EMFILE: "too many open files",
|
EMFILE: "too many open files",
|
||||||
ENOTTY: "not a typewriter",
|
ENOTTY: "not a typewriter",
|
||||||
EFBIG: "file too large",
|
EFBIG: "file too large",
|
||||||
ENOSPC: "no space left on device",
|
ENOSPC: "no space left on device",
|
||||||
ESPIPE: "illegal seek",
|
ESPIPE: "illegal seek",
|
||||||
EROFS: "read-only file system",
|
EROFS: "read-only file system",
|
||||||
EMLINK: "too many links",
|
EMLINK: "too many links",
|
||||||
EPIPE: "broken pipe",
|
EPIPE: "broken pipe",
|
||||||
ENAMETOOLONG: "file name too long",
|
ENAMETOOLONG: "file name too long",
|
||||||
ENOSYS: "function not implemented",
|
ENOSYS: "function not implemented",
|
||||||
EDQUOT: "quota exceeded",
|
EDQUOT: "quota exceeded",
|
||||||
EDOM: "math arg out of domain of func",
|
EDOM: "math arg out of domain of func",
|
||||||
ERANGE: "math result not representable",
|
ERANGE: "math result not representable",
|
||||||
ENOMSG: "no message of desired type",
|
ENOMSG: "no message of desired type",
|
||||||
ECHRNG: "channel number out of range",
|
ECHRNG: "channel number out of range",
|
||||||
EL3HLT: "level 3 halted",
|
EL3HLT: "level 3 halted",
|
||||||
EL3RST: "level 3 reset",
|
EL3RST: "level 3 reset",
|
||||||
ELNRNG: "link number out of range",
|
ELNRNG: "link number out of range",
|
||||||
EUNATCH: "protocol driver not attached",
|
EUNATCH: "protocol driver not attached",
|
||||||
ENOCSI: "no CSI structure available",
|
ENOCSI: "no CSI structure available",
|
||||||
EL2HLT: "level 2 halted",
|
EL2HLT: "level 2 halted",
|
||||||
EDEADLK: "deadlock condition",
|
EDEADLK: "deadlock condition",
|
||||||
ENOLCK: "no record locks available",
|
ENOLCK: "no record locks available",
|
||||||
EBADE: "invalid exchange",
|
EBADE: "invalid exchange",
|
||||||
EBADR: "invalid request descriptor",
|
EBADR: "invalid request descriptor",
|
||||||
EXFULL: "exchange full",
|
EXFULL: "exchange full",
|
||||||
ENOANO: "no anode",
|
ENOANO: "no anode",
|
||||||
EBADRQC: "invalid request code",
|
EBADRQC: "invalid request code",
|
||||||
EBADSLT: "invalid slot",
|
EBADSLT: "invalid slot",
|
||||||
EBFONT: "bad font file fmt",
|
EBFONT: "bad font file fmt",
|
||||||
ENOSTR: "device not a stream",
|
ENOSTR: "device not a stream",
|
||||||
ENODATA: "no data (for no delay io)",
|
ENODATA: "no data (for no delay io)",
|
||||||
ETIME: "timer expired",
|
ETIME: "timer expired",
|
||||||
ENOSR: "out of streams resources",
|
ENOSR: "out of streams resources",
|
||||||
ENONET: "machine is not on the network",
|
ENONET: "machine is not on the network",
|
||||||
ENOPKG: "package not installed",
|
ENOPKG: "package not installed",
|
||||||
EREMOTE: "the object is remote",
|
EREMOTE: "the object is remote",
|
||||||
ENOLINK: "the link has been severed",
|
ENOLINK: "the link has been severed",
|
||||||
EADV: "advertise error",
|
EADV: "advertise error",
|
||||||
ESRMNT: "srmount error",
|
ESRMNT: "srmount error",
|
||||||
ECOMM: "communication error on send",
|
ECOMM: "communication error on send",
|
||||||
EPROTO: "protocol error",
|
EPROTO: "protocol error",
|
||||||
EMULTIHOP: "multihop attempted",
|
EMULTIHOP: "multihop attempted",
|
||||||
ELBIN: "inode is remote (not really error)",
|
ELBIN: "inode is remote (not really error)",
|
||||||
EDOTDOT: "cross mount point (not really error)",
|
EDOTDOT: "cross mount point (not really error)",
|
||||||
EBADMSG: "trying to read unreadable message",
|
EBADMSG: "trying to read unreadable message",
|
||||||
EFTYPE: "inappropriate file type or format",
|
EFTYPE: "inappropriate file type or format",
|
||||||
ENOTUNIQ: "given log. name not unique",
|
ENOTUNIQ: "given log. name not unique",
|
||||||
EBADFD: "f.d. invalid for this operation",
|
EBADFD: "f.d. invalid for this operation",
|
||||||
EREMCHG: "remote address changed",
|
EREMCHG: "remote address changed",
|
||||||
ELIBACC: "can't access a needed shared lib",
|
ELIBACC: "can't access a needed shared lib",
|
||||||
ELIBBAD: "accessing a corrupted shared lib",
|
ELIBBAD: "accessing a corrupted shared lib",
|
||||||
ELIBSCN: ".lib section in a.out corrupted",
|
ELIBSCN: ".lib section in a.out corrupted",
|
||||||
ELIBMAX: "attempting to link in too many libs",
|
ELIBMAX: "attempting to link in too many libs",
|
||||||
ELIBEXEC: "attempting to exec a shared library",
|
ELIBEXEC: "attempting to exec a shared library",
|
||||||
ENMFILE: "no more files",
|
ENMFILE: "no more files",
|
||||||
ENOTEMPTY: "directory not empty",
|
ENOTEMPTY: "directory not empty",
|
||||||
ELOOP: "too many symbolic links",
|
ELOOP: "too many symbolic links",
|
||||||
EOPNOTSUPP: "operation not supported on transport endpoint",
|
EOPNOTSUPP: "operation not supported on transport endpoint",
|
||||||
EPFNOSUPPORT: "protocol family not supported",
|
EPFNOSUPPORT: "protocol family not supported",
|
||||||
ECONNRESET: "connection reset by peer",
|
ECONNRESET: "connection reset by peer",
|
||||||
ENOBUFS: "no buffer space available",
|
ENOBUFS: "no buffer space available",
|
||||||
EAFNOSUPPORT: "address family not supported by protocol family",
|
EAFNOSUPPORT: "address family not supported by protocol family",
|
||||||
EPROTOTYPE: "protocol wrong type for socket",
|
EPROTOTYPE: "protocol wrong type for socket",
|
||||||
ENOTSOCK: "socket operation on non-socket",
|
ENOTSOCK: "socket operation on non-socket",
|
||||||
ENOPROTOOPT: "protocol not available",
|
ENOPROTOOPT: "protocol not available",
|
||||||
ESHUTDOWN: "can't send after socket shutdown",
|
ESHUTDOWN: "can't send after socket shutdown",
|
||||||
ECONNREFUSED: "connection refused",
|
ECONNREFUSED: "connection refused",
|
||||||
EADDRINUSE: "address already in use",
|
EADDRINUSE: "address already in use",
|
||||||
ECONNABORTED: "connection aborted",
|
ECONNABORTED: "connection aborted",
|
||||||
ENETUNREACH: "network is unreachable",
|
ENETUNREACH: "network is unreachable",
|
||||||
ENETDOWN: "network interface is not configured",
|
ENETDOWN: "network interface is not configured",
|
||||||
ETIMEDOUT: "connection timed out",
|
ETIMEDOUT: "connection timed out",
|
||||||
EHOSTDOWN: "host is down",
|
EHOSTDOWN: "host is down",
|
||||||
EHOSTUNREACH: "host is unreachable",
|
EHOSTUNREACH: "host is unreachable",
|
||||||
EINPROGRESS: "connection already in progress",
|
EINPROGRESS: "connection already in progress",
|
||||||
EALREADY: "socket already connected",
|
EALREADY: "socket already connected",
|
||||||
EDESTADDRREQ: "destination address required",
|
EDESTADDRREQ: "destination address required",
|
||||||
EPROTONOSUPPORT: "unknown protocol",
|
EPROTONOSUPPORT: "unknown protocol",
|
||||||
ESOCKTNOSUPPORT: "socket type not supported",
|
ESOCKTNOSUPPORT: "socket type not supported",
|
||||||
EADDRNOTAVAIL: "address not available",
|
EADDRNOTAVAIL: "address not available",
|
||||||
EISCONN: "socket is already connected",
|
EISCONN: "socket is already connected",
|
||||||
ENOTCONN: "socket is not connected",
|
ENOTCONN: "socket is not connected",
|
||||||
ENOMEDIUM: "no medium (in tape drive)",
|
ENOMEDIUM: "no medium (in tape drive)",
|
||||||
ENOSHARE: "no such host or network path",
|
ENOSHARE: "no such host or network path",
|
||||||
ECASECLASH: "filename exists with different case",
|
ECASECLASH: "filename exists with different case",
|
||||||
EOVERFLOW: "value too large for defined data type",
|
EOVERFLOW: "value too large for defined data type",
|
||||||
ECANCELED: "operation canceled.",
|
ECANCELED: "operation canceled.",
|
||||||
EL2NSYNC: "level 2 not synchronized",
|
EL2NSYNC: "level 2 not synchronized",
|
||||||
EIDRM: "identifier removed",
|
EIDRM: "identifier removed",
|
||||||
EMSGSIZE: "message too long",
|
EMSGSIZE: "message too long",
|
||||||
ENACL: "not supported by native client",
|
ENACL: "not supported by native client",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,8 @@ type FormatterMap map[string]func(io.Writer, interface{}, string)
|
||||||
// Built-in formatters.
|
// Built-in formatters.
|
||||||
var builtins = FormatterMap{
|
var builtins = FormatterMap{
|
||||||
"html": HTMLFormatter,
|
"html": HTMLFormatter,
|
||||||
"str": StringFormatter,
|
"str": StringFormatter,
|
||||||
"": StringFormatter,
|
"": StringFormatter,
|
||||||
}
|
}
|
||||||
|
|
||||||
// The parsed state of a template is a vector of xxxElement structs.
|
// The parsed state of a template is a vector of xxxElement structs.
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ func writer(f func(interface{}) string) func(io.Writer, interface{}, string) {
|
||||||
|
|
||||||
var formatters = FormatterMap{
|
var formatters = FormatterMap{
|
||||||
"uppercase": writer(uppercase),
|
"uppercase": writer(uppercase),
|
||||||
"+1": writer(plus1),
|
"+1": writer(plus1),
|
||||||
}
|
}
|
||||||
|
|
||||||
var tests = []*Test{
|
var tests = []*Test{
|
||||||
|
|
|
||||||
|
|
@ -9,36 +9,36 @@ const Version = "5.2.0"
|
||||||
|
|
||||||
// Categories is the set of Unicode data tables.
|
// Categories is the set of Unicode data tables.
|
||||||
var Categories = map[string][]Range{
|
var Categories = map[string][]Range{
|
||||||
"Lm": Lm,
|
"Lm": Lm,
|
||||||
"Ll": Ll,
|
"Ll": Ll,
|
||||||
"Me": Me,
|
"Me": Me,
|
||||||
"Mc": Mc,
|
"Mc": Mc,
|
||||||
"Mn": Mn,
|
"Mn": Mn,
|
||||||
"Zl": Zl,
|
"Zl": Zl,
|
||||||
"letter": letter,
|
"letter": letter,
|
||||||
"Zp": Zp,
|
"Zp": Zp,
|
||||||
"Zs": Zs,
|
"Zs": Zs,
|
||||||
"Cs": Cs,
|
"Cs": Cs,
|
||||||
"Co": Co,
|
"Co": Co,
|
||||||
"Cf": Cf,
|
"Cf": Cf,
|
||||||
"Cc": Cc,
|
"Cc": Cc,
|
||||||
"Po": Po,
|
"Po": Po,
|
||||||
"Pi": Pi,
|
"Pi": Pi,
|
||||||
"Pf": Pf,
|
"Pf": Pf,
|
||||||
"Pe": Pe,
|
"Pe": Pe,
|
||||||
"Pd": Pd,
|
"Pd": Pd,
|
||||||
"Pc": Pc,
|
"Pc": Pc,
|
||||||
"Ps": Ps,
|
"Ps": Ps,
|
||||||
"Nd": Nd,
|
"Nd": Nd,
|
||||||
"Nl": Nl,
|
"Nl": Nl,
|
||||||
"No": No,
|
"No": No,
|
||||||
"So": So,
|
"So": So,
|
||||||
"Sm": Sm,
|
"Sm": Sm,
|
||||||
"Sk": Sk,
|
"Sk": Sk,
|
||||||
"Sc": Sc,
|
"Sc": Sc,
|
||||||
"Lu": Lu,
|
"Lu": Lu,
|
||||||
"Lt": Lt,
|
"Lt": Lt,
|
||||||
"Lo": Lo,
|
"Lo": Lo,
|
||||||
}
|
}
|
||||||
|
|
||||||
var _Lm = []Range{
|
var _Lm = []Range{
|
||||||
|
|
@ -1963,98 +1963,98 @@ var (
|
||||||
|
|
||||||
// Scripts is the set of Unicode script tables.
|
// Scripts is the set of Unicode script tables.
|
||||||
var Scripts = map[string][]Range{
|
var Scripts = map[string][]Range{
|
||||||
"Katakana": Katakana,
|
"Katakana": Katakana,
|
||||||
"Malayalam": Malayalam,
|
"Malayalam": Malayalam,
|
||||||
"Phags_Pa": Phags_Pa,
|
"Phags_Pa": Phags_Pa,
|
||||||
"Inscriptional_Parthian": Inscriptional_Parthian,
|
"Inscriptional_Parthian": Inscriptional_Parthian,
|
||||||
"Latin": Latin,
|
"Latin": Latin,
|
||||||
"Inscriptional_Pahlavi": Inscriptional_Pahlavi,
|
"Inscriptional_Pahlavi": Inscriptional_Pahlavi,
|
||||||
"Osmanya": Osmanya,
|
"Osmanya": Osmanya,
|
||||||
"Khmer": Khmer,
|
"Khmer": Khmer,
|
||||||
"Inherited": Inherited,
|
"Inherited": Inherited,
|
||||||
"Telugu": Telugu,
|
"Telugu": Telugu,
|
||||||
"Samaritan": Samaritan,
|
"Samaritan": Samaritan,
|
||||||
"Bopomofo": Bopomofo,
|
"Bopomofo": Bopomofo,
|
||||||
"Imperial_Aramaic": Imperial_Aramaic,
|
"Imperial_Aramaic": Imperial_Aramaic,
|
||||||
"Kaithi": Kaithi,
|
"Kaithi": Kaithi,
|
||||||
"Old_South_Arabian": Old_South_Arabian,
|
"Old_South_Arabian": Old_South_Arabian,
|
||||||
"Kayah_Li": Kayah_Li,
|
"Kayah_Li": Kayah_Li,
|
||||||
"New_Tai_Lue": New_Tai_Lue,
|
"New_Tai_Lue": New_Tai_Lue,
|
||||||
"Tai_Le": Tai_Le,
|
"Tai_Le": Tai_Le,
|
||||||
"Kharoshthi": Kharoshthi,
|
"Kharoshthi": Kharoshthi,
|
||||||
"Common": Common,
|
"Common": Common,
|
||||||
"Kannada": Kannada,
|
"Kannada": Kannada,
|
||||||
"Old_Turkic": Old_Turkic,
|
"Old_Turkic": Old_Turkic,
|
||||||
"Tamil": Tamil,
|
"Tamil": Tamil,
|
||||||
"Tagalog": Tagalog,
|
"Tagalog": Tagalog,
|
||||||
"Arabic": Arabic,
|
"Arabic": Arabic,
|
||||||
"Tagbanwa": Tagbanwa,
|
"Tagbanwa": Tagbanwa,
|
||||||
"Canadian_Aboriginal": Canadian_Aboriginal,
|
"Canadian_Aboriginal": Canadian_Aboriginal,
|
||||||
"Tibetan": Tibetan,
|
"Tibetan": Tibetan,
|
||||||
"Coptic": Coptic,
|
"Coptic": Coptic,
|
||||||
"Hiragana": Hiragana,
|
"Hiragana": Hiragana,
|
||||||
"Limbu": Limbu,
|
"Limbu": Limbu,
|
||||||
"Egyptian_Hieroglyphs": Egyptian_Hieroglyphs,
|
"Egyptian_Hieroglyphs": Egyptian_Hieroglyphs,
|
||||||
"Avestan": Avestan,
|
"Avestan": Avestan,
|
||||||
"Myanmar": Myanmar,
|
"Myanmar": Myanmar,
|
||||||
"Armenian": Armenian,
|
"Armenian": Armenian,
|
||||||
"Sinhala": Sinhala,
|
"Sinhala": Sinhala,
|
||||||
"Bengali": Bengali,
|
"Bengali": Bengali,
|
||||||
"Greek": Greek,
|
"Greek": Greek,
|
||||||
"Cham": Cham,
|
"Cham": Cham,
|
||||||
"Hebrew": Hebrew,
|
"Hebrew": Hebrew,
|
||||||
"Meetei_Mayek": Meetei_Mayek,
|
"Meetei_Mayek": Meetei_Mayek,
|
||||||
"Saurashtra": Saurashtra,
|
"Saurashtra": Saurashtra,
|
||||||
"Hangul": Hangul,
|
"Hangul": Hangul,
|
||||||
"Runic": Runic,
|
"Runic": Runic,
|
||||||
"Deseret": Deseret,
|
"Deseret": Deseret,
|
||||||
"Lisu": Lisu,
|
"Lisu": Lisu,
|
||||||
"Sundanese": Sundanese,
|
"Sundanese": Sundanese,
|
||||||
"Glagolitic": Glagolitic,
|
"Glagolitic": Glagolitic,
|
||||||
"Oriya": Oriya,
|
"Oriya": Oriya,
|
||||||
"Buhid": Buhid,
|
"Buhid": Buhid,
|
||||||
"Ethiopic": Ethiopic,
|
"Ethiopic": Ethiopic,
|
||||||
"Javanese": Javanese,
|
"Javanese": Javanese,
|
||||||
"Syloti_Nagri": Syloti_Nagri,
|
"Syloti_Nagri": Syloti_Nagri,
|
||||||
"Vai": Vai,
|
"Vai": Vai,
|
||||||
"Cherokee": Cherokee,
|
"Cherokee": Cherokee,
|
||||||
"Ogham": Ogham,
|
"Ogham": Ogham,
|
||||||
"Syriac": Syriac,
|
"Syriac": Syriac,
|
||||||
"Gurmukhi": Gurmukhi,
|
"Gurmukhi": Gurmukhi,
|
||||||
"Tai_Tham": Tai_Tham,
|
"Tai_Tham": Tai_Tham,
|
||||||
"Ol_Chiki": Ol_Chiki,
|
"Ol_Chiki": Ol_Chiki,
|
||||||
"Mongolian": Mongolian,
|
"Mongolian": Mongolian,
|
||||||
"Hanunoo": Hanunoo,
|
"Hanunoo": Hanunoo,
|
||||||
"Cypriot": Cypriot,
|
"Cypriot": Cypriot,
|
||||||
"Buginese": Buginese,
|
"Buginese": Buginese,
|
||||||
"Bamum": Bamum,
|
"Bamum": Bamum,
|
||||||
"Lepcha": Lepcha,
|
"Lepcha": Lepcha,
|
||||||
"Thaana": Thaana,
|
"Thaana": Thaana,
|
||||||
"Old_Persian": Old_Persian,
|
"Old_Persian": Old_Persian,
|
||||||
"Cuneiform": Cuneiform,
|
"Cuneiform": Cuneiform,
|
||||||
"Rejang": Rejang,
|
"Rejang": Rejang,
|
||||||
"Georgian": Georgian,
|
"Georgian": Georgian,
|
||||||
"Shavian": Shavian,
|
"Shavian": Shavian,
|
||||||
"Lycian": Lycian,
|
"Lycian": Lycian,
|
||||||
"Nko": Nko,
|
"Nko": Nko,
|
||||||
"Yi": Yi,
|
"Yi": Yi,
|
||||||
"Lao": Lao,
|
"Lao": Lao,
|
||||||
"Linear_B": Linear_B,
|
"Linear_B": Linear_B,
|
||||||
"Old_Italic": Old_Italic,
|
"Old_Italic": Old_Italic,
|
||||||
"Tai_Viet": Tai_Viet,
|
"Tai_Viet": Tai_Viet,
|
||||||
"Devanagari": Devanagari,
|
"Devanagari": Devanagari,
|
||||||
"Lydian": Lydian,
|
"Lydian": Lydian,
|
||||||
"Tifinagh": Tifinagh,
|
"Tifinagh": Tifinagh,
|
||||||
"Ugaritic": Ugaritic,
|
"Ugaritic": Ugaritic,
|
||||||
"Thai": Thai,
|
"Thai": Thai,
|
||||||
"Cyrillic": Cyrillic,
|
"Cyrillic": Cyrillic,
|
||||||
"Gujarati": Gujarati,
|
"Gujarati": Gujarati,
|
||||||
"Carian": Carian,
|
"Carian": Carian,
|
||||||
"Phoenician": Phoenician,
|
"Phoenician": Phoenician,
|
||||||
"Balinese": Balinese,
|
"Balinese": Balinese,
|
||||||
"Braille": Braille,
|
"Braille": Braille,
|
||||||
"Han": Han,
|
"Han": Han,
|
||||||
"Gothic": Gothic,
|
"Gothic": Gothic,
|
||||||
}
|
}
|
||||||
|
|
||||||
var _Katakana = []Range{
|
var _Katakana = []Range{
|
||||||
|
|
@ -3090,36 +3090,36 @@ var (
|
||||||
|
|
||||||
// Properties is the set of Unicode property tables.
|
// Properties is the set of Unicode property tables.
|
||||||
var Properties = map[string][]Range{
|
var Properties = map[string][]Range{
|
||||||
"Pattern_Syntax": Pattern_Syntax,
|
"Pattern_Syntax": Pattern_Syntax,
|
||||||
"Other_ID_Start": Other_ID_Start,
|
"Other_ID_Start": Other_ID_Start,
|
||||||
"Pattern_White_Space": Pattern_White_Space,
|
"Pattern_White_Space": Pattern_White_Space,
|
||||||
"Other_Lowercase": Other_Lowercase,
|
"Other_Lowercase": Other_Lowercase,
|
||||||
"Soft_Dotted": Soft_Dotted,
|
"Soft_Dotted": Soft_Dotted,
|
||||||
"Hex_Digit": Hex_Digit,
|
"Hex_Digit": Hex_Digit,
|
||||||
"ASCII_Hex_Digit": ASCII_Hex_Digit,
|
"ASCII_Hex_Digit": ASCII_Hex_Digit,
|
||||||
"Deprecated": Deprecated,
|
"Deprecated": Deprecated,
|
||||||
"Terminal_Punctuation": Terminal_Punctuation,
|
"Terminal_Punctuation": Terminal_Punctuation,
|
||||||
"Quotation_Mark": Quotation_Mark,
|
"Quotation_Mark": Quotation_Mark,
|
||||||
"Other_ID_Continue": Other_ID_Continue,
|
"Other_ID_Continue": Other_ID_Continue,
|
||||||
"Bidi_Control": Bidi_Control,
|
"Bidi_Control": Bidi_Control,
|
||||||
"Variation_Selector": Variation_Selector,
|
"Variation_Selector": Variation_Selector,
|
||||||
"Noncharacter_Code_Point": Noncharacter_Code_Point,
|
"Noncharacter_Code_Point": Noncharacter_Code_Point,
|
||||||
"Other_Math": Other_Math,
|
"Other_Math": Other_Math,
|
||||||
"Unified_Ideograph": Unified_Ideograph,
|
"Unified_Ideograph": Unified_Ideograph,
|
||||||
"Hyphen": Hyphen,
|
"Hyphen": Hyphen,
|
||||||
"IDS_Binary_Operator": IDS_Binary_Operator,
|
"IDS_Binary_Operator": IDS_Binary_Operator,
|
||||||
"Logical_Order_Exception": Logical_Order_Exception,
|
"Logical_Order_Exception": Logical_Order_Exception,
|
||||||
"Radical": Radical,
|
"Radical": Radical,
|
||||||
"Other_Uppercase": Other_Uppercase,
|
"Other_Uppercase": Other_Uppercase,
|
||||||
"STerm": STerm,
|
"STerm": STerm,
|
||||||
"Other_Alphabetic": Other_Alphabetic,
|
"Other_Alphabetic": Other_Alphabetic,
|
||||||
"Diacritic": Diacritic,
|
"Diacritic": Diacritic,
|
||||||
"Extender": Extender,
|
"Extender": Extender,
|
||||||
"Join_Control": Join_Control,
|
"Join_Control": Join_Control,
|
||||||
"Ideographic": Ideographic,
|
"Ideographic": Ideographic,
|
||||||
"Dash": Dash,
|
"Dash": Dash,
|
||||||
"IDS_Trinary_Operator": IDS_Trinary_Operator,
|
"IDS_Trinary_Operator": IDS_Trinary_Operator,
|
||||||
"Other_Grapheme_Extend": Other_Grapheme_Extend,
|
"Other_Grapheme_Extend": Other_Grapheme_Extend,
|
||||||
"Other_Default_Ignorable_Code_Point": Other_Default_Ignorable_Code_Point,
|
"Other_Default_Ignorable_Code_Point": Other_Default_Ignorable_Code_Point,
|
||||||
"White_Space": White_Space,
|
"White_Space": White_Space,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -216,9 +216,9 @@ func (c *Conn) readNextReply() os.Error {
|
||||||
err := &Error{
|
err := &Error{
|
||||||
Detail: buf[1],
|
Detail: buf[1],
|
||||||
Cookie: Cookie(get16(buf[2:])),
|
Cookie: Cookie(get16(buf[2:])),
|
||||||
Id: Id(get32(buf[4:])),
|
Id: Id(get32(buf[4:])),
|
||||||
Minor: get16(buf[8:]),
|
Minor: get16(buf[8:]),
|
||||||
Major: buf[10],
|
Major: buf[10],
|
||||||
}
|
}
|
||||||
fmt.Fprintf(os.Stderr, "x protocol error: %s\n", err)
|
fmt.Fprintf(os.Stderr, "x protocol error: %s\n", err)
|
||||||
return err
|
return err
|
||||||
|
|
|
||||||
|
|
@ -4133,21 +4133,21 @@ func parseEvent(buf []byte) (Event, os.Error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var errorNames = map[byte]string{
|
var errorNames = map[byte]string{
|
||||||
BadRequest: "Request",
|
BadRequest: "Request",
|
||||||
BadValue: "Value",
|
BadValue: "Value",
|
||||||
BadWindow: "Window",
|
BadWindow: "Window",
|
||||||
BadPixmap: "Pixmap",
|
BadPixmap: "Pixmap",
|
||||||
BadAtom: "Atom",
|
BadAtom: "Atom",
|
||||||
BadCursor: "Cursor",
|
BadCursor: "Cursor",
|
||||||
BadFont: "Font",
|
BadFont: "Font",
|
||||||
BadMatch: "Match",
|
BadMatch: "Match",
|
||||||
BadDrawable: "Drawable",
|
BadDrawable: "Drawable",
|
||||||
BadAccess: "Access",
|
BadAccess: "Access",
|
||||||
BadAlloc: "Alloc",
|
BadAlloc: "Alloc",
|
||||||
BadColormap: "Colormap",
|
BadColormap: "Colormap",
|
||||||
BadGContext: "GContext",
|
BadGContext: "GContext",
|
||||||
BadIDChoice: "IDChoice",
|
BadIDChoice: "IDChoice",
|
||||||
BadName: "Name",
|
BadName: "Name",
|
||||||
BadLength: "Length",
|
BadLength: "Length",
|
||||||
BadImplementation: "Implementation",
|
BadImplementation: "Implementation",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -116,12 +116,12 @@ type Time string
|
||||||
|
|
||||||
var rssFeed = Feed{
|
var rssFeed = Feed{
|
||||||
XMLName: Name{"http://www.w3.org/2005/Atom", "feed"},
|
XMLName: Name{"http://www.w3.org/2005/Atom", "feed"},
|
||||||
Title: "Code Review - My issues",
|
Title: "Code Review - My issues",
|
||||||
Link: []Link{
|
Link: []Link{
|
||||||
Link{Rel: "alternate", Href: "http://codereview.appspot.com/"},
|
Link{Rel: "alternate", Href: "http://codereview.appspot.com/"},
|
||||||
Link{Rel: "self", Href: "http://codereview.appspot.com/rss/mine/rsc"},
|
Link{Rel: "self", Href: "http://codereview.appspot.com/rss/mine/rsc"},
|
||||||
},
|
},
|
||||||
Id: "http://codereview.appspot.com/",
|
Id: "http://codereview.appspot.com/",
|
||||||
Updated: "2009-10-04T01:35:58+00:00",
|
Updated: "2009-10-04T01:35:58+00:00",
|
||||||
Author: Person{
|
Author: Person{
|
||||||
Name: "rietveld",
|
Name: "rietveld",
|
||||||
|
|
|
||||||
|
|
@ -156,10 +156,10 @@ type Parser struct {
|
||||||
// NewParser creates a new XML parser reading from r.
|
// NewParser creates a new XML parser reading from r.
|
||||||
func NewParser(r io.Reader) *Parser {
|
func NewParser(r io.Reader) *Parser {
|
||||||
p := &Parser{
|
p := &Parser{
|
||||||
ns: make(map[string]string),
|
ns: make(map[string]string),
|
||||||
nextByte: -1,
|
nextByte: -1,
|
||||||
line: 1,
|
line: 1,
|
||||||
Strict: true,
|
Strict: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get efficient byte at a time reader.
|
// Get efficient byte at a time reader.
|
||||||
|
|
@ -698,9 +698,9 @@ func (p *Parser) ungetc(b byte) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = map[string]int{
|
var entity = map[string]int{
|
||||||
"lt": '<',
|
"lt": '<',
|
||||||
"gt": '>',
|
"gt": '>',
|
||||||
"amp": '&',
|
"amp": '&',
|
||||||
"apos": '\'',
|
"apos": '\'',
|
||||||
"quot": '"',
|
"quot": '"',
|
||||||
}
|
}
|
||||||
|
|
@ -1229,258 +1229,258 @@ var htmlEntity = map[string]string{
|
||||||
,s/\<!ENTITY ([^ ]+) .*U\+([0-9A-F][0-9A-F][0-9A-F][0-9A-F]) .+/ "\1": "\\u\2",/g
|
,s/\<!ENTITY ([^ ]+) .*U\+([0-9A-F][0-9A-F][0-9A-F][0-9A-F]) .+/ "\1": "\\u\2",/g
|
||||||
'
|
'
|
||||||
*/
|
*/
|
||||||
"nbsp": "\u00A0",
|
"nbsp": "\u00A0",
|
||||||
"iexcl": "\u00A1",
|
"iexcl": "\u00A1",
|
||||||
"cent": "\u00A2",
|
"cent": "\u00A2",
|
||||||
"pound": "\u00A3",
|
"pound": "\u00A3",
|
||||||
"curren": "\u00A4",
|
"curren": "\u00A4",
|
||||||
"yen": "\u00A5",
|
"yen": "\u00A5",
|
||||||
"brvbar": "\u00A6",
|
"brvbar": "\u00A6",
|
||||||
"sect": "\u00A7",
|
"sect": "\u00A7",
|
||||||
"uml": "\u00A8",
|
"uml": "\u00A8",
|
||||||
"copy": "\u00A9",
|
"copy": "\u00A9",
|
||||||
"ordf": "\u00AA",
|
"ordf": "\u00AA",
|
||||||
"laquo": "\u00AB",
|
"laquo": "\u00AB",
|
||||||
"not": "\u00AC",
|
"not": "\u00AC",
|
||||||
"shy": "\u00AD",
|
"shy": "\u00AD",
|
||||||
"reg": "\u00AE",
|
"reg": "\u00AE",
|
||||||
"macr": "\u00AF",
|
"macr": "\u00AF",
|
||||||
"deg": "\u00B0",
|
"deg": "\u00B0",
|
||||||
"plusmn": "\u00B1",
|
"plusmn": "\u00B1",
|
||||||
"sup2": "\u00B2",
|
"sup2": "\u00B2",
|
||||||
"sup3": "\u00B3",
|
"sup3": "\u00B3",
|
||||||
"acute": "\u00B4",
|
"acute": "\u00B4",
|
||||||
"micro": "\u00B5",
|
"micro": "\u00B5",
|
||||||
"para": "\u00B6",
|
"para": "\u00B6",
|
||||||
"middot": "\u00B7",
|
"middot": "\u00B7",
|
||||||
"cedil": "\u00B8",
|
"cedil": "\u00B8",
|
||||||
"sup1": "\u00B9",
|
"sup1": "\u00B9",
|
||||||
"ordm": "\u00BA",
|
"ordm": "\u00BA",
|
||||||
"raquo": "\u00BB",
|
"raquo": "\u00BB",
|
||||||
"frac14": "\u00BC",
|
"frac14": "\u00BC",
|
||||||
"frac12": "\u00BD",
|
"frac12": "\u00BD",
|
||||||
"frac34": "\u00BE",
|
"frac34": "\u00BE",
|
||||||
"iquest": "\u00BF",
|
"iquest": "\u00BF",
|
||||||
"Agrave": "\u00C0",
|
"Agrave": "\u00C0",
|
||||||
"Aacute": "\u00C1",
|
"Aacute": "\u00C1",
|
||||||
"Acirc": "\u00C2",
|
"Acirc": "\u00C2",
|
||||||
"Atilde": "\u00C3",
|
"Atilde": "\u00C3",
|
||||||
"Auml": "\u00C4",
|
"Auml": "\u00C4",
|
||||||
"Aring": "\u00C5",
|
"Aring": "\u00C5",
|
||||||
"AElig": "\u00C6",
|
"AElig": "\u00C6",
|
||||||
"Ccedil": "\u00C7",
|
"Ccedil": "\u00C7",
|
||||||
"Egrave": "\u00C8",
|
"Egrave": "\u00C8",
|
||||||
"Eacute": "\u00C9",
|
"Eacute": "\u00C9",
|
||||||
"Ecirc": "\u00CA",
|
"Ecirc": "\u00CA",
|
||||||
"Euml": "\u00CB",
|
"Euml": "\u00CB",
|
||||||
"Igrave": "\u00CC",
|
"Igrave": "\u00CC",
|
||||||
"Iacute": "\u00CD",
|
"Iacute": "\u00CD",
|
||||||
"Icirc": "\u00CE",
|
"Icirc": "\u00CE",
|
||||||
"Iuml": "\u00CF",
|
"Iuml": "\u00CF",
|
||||||
"ETH": "\u00D0",
|
"ETH": "\u00D0",
|
||||||
"Ntilde": "\u00D1",
|
"Ntilde": "\u00D1",
|
||||||
"Ograve": "\u00D2",
|
"Ograve": "\u00D2",
|
||||||
"Oacute": "\u00D3",
|
"Oacute": "\u00D3",
|
||||||
"Ocirc": "\u00D4",
|
"Ocirc": "\u00D4",
|
||||||
"Otilde": "\u00D5",
|
"Otilde": "\u00D5",
|
||||||
"Ouml": "\u00D6",
|
"Ouml": "\u00D6",
|
||||||
"times": "\u00D7",
|
"times": "\u00D7",
|
||||||
"Oslash": "\u00D8",
|
"Oslash": "\u00D8",
|
||||||
"Ugrave": "\u00D9",
|
"Ugrave": "\u00D9",
|
||||||
"Uacute": "\u00DA",
|
"Uacute": "\u00DA",
|
||||||
"Ucirc": "\u00DB",
|
"Ucirc": "\u00DB",
|
||||||
"Uuml": "\u00DC",
|
"Uuml": "\u00DC",
|
||||||
"Yacute": "\u00DD",
|
"Yacute": "\u00DD",
|
||||||
"THORN": "\u00DE",
|
"THORN": "\u00DE",
|
||||||
"szlig": "\u00DF",
|
"szlig": "\u00DF",
|
||||||
"agrave": "\u00E0",
|
"agrave": "\u00E0",
|
||||||
"aacute": "\u00E1",
|
"aacute": "\u00E1",
|
||||||
"acirc": "\u00E2",
|
"acirc": "\u00E2",
|
||||||
"atilde": "\u00E3",
|
"atilde": "\u00E3",
|
||||||
"auml": "\u00E4",
|
"auml": "\u00E4",
|
||||||
"aring": "\u00E5",
|
"aring": "\u00E5",
|
||||||
"aelig": "\u00E6",
|
"aelig": "\u00E6",
|
||||||
"ccedil": "\u00E7",
|
"ccedil": "\u00E7",
|
||||||
"egrave": "\u00E8",
|
"egrave": "\u00E8",
|
||||||
"eacute": "\u00E9",
|
"eacute": "\u00E9",
|
||||||
"ecirc": "\u00EA",
|
"ecirc": "\u00EA",
|
||||||
"euml": "\u00EB",
|
"euml": "\u00EB",
|
||||||
"igrave": "\u00EC",
|
"igrave": "\u00EC",
|
||||||
"iacute": "\u00ED",
|
"iacute": "\u00ED",
|
||||||
"icirc": "\u00EE",
|
"icirc": "\u00EE",
|
||||||
"iuml": "\u00EF",
|
"iuml": "\u00EF",
|
||||||
"eth": "\u00F0",
|
"eth": "\u00F0",
|
||||||
"ntilde": "\u00F1",
|
"ntilde": "\u00F1",
|
||||||
"ograve": "\u00F2",
|
"ograve": "\u00F2",
|
||||||
"oacute": "\u00F3",
|
"oacute": "\u00F3",
|
||||||
"ocirc": "\u00F4",
|
"ocirc": "\u00F4",
|
||||||
"otilde": "\u00F5",
|
"otilde": "\u00F5",
|
||||||
"ouml": "\u00F6",
|
"ouml": "\u00F6",
|
||||||
"divide": "\u00F7",
|
"divide": "\u00F7",
|
||||||
"oslash": "\u00F8",
|
"oslash": "\u00F8",
|
||||||
"ugrave": "\u00F9",
|
"ugrave": "\u00F9",
|
||||||
"uacute": "\u00FA",
|
"uacute": "\u00FA",
|
||||||
"ucirc": "\u00FB",
|
"ucirc": "\u00FB",
|
||||||
"uuml": "\u00FC",
|
"uuml": "\u00FC",
|
||||||
"yacute": "\u00FD",
|
"yacute": "\u00FD",
|
||||||
"thorn": "\u00FE",
|
"thorn": "\u00FE",
|
||||||
"yuml": "\u00FF",
|
"yuml": "\u00FF",
|
||||||
"fnof": "\u0192",
|
"fnof": "\u0192",
|
||||||
"Alpha": "\u0391",
|
"Alpha": "\u0391",
|
||||||
"Beta": "\u0392",
|
"Beta": "\u0392",
|
||||||
"Gamma": "\u0393",
|
"Gamma": "\u0393",
|
||||||
"Delta": "\u0394",
|
"Delta": "\u0394",
|
||||||
"Epsilon": "\u0395",
|
"Epsilon": "\u0395",
|
||||||
"Zeta": "\u0396",
|
"Zeta": "\u0396",
|
||||||
"Eta": "\u0397",
|
"Eta": "\u0397",
|
||||||
"Theta": "\u0398",
|
"Theta": "\u0398",
|
||||||
"Iota": "\u0399",
|
"Iota": "\u0399",
|
||||||
"Kappa": "\u039A",
|
"Kappa": "\u039A",
|
||||||
"Lambda": "\u039B",
|
"Lambda": "\u039B",
|
||||||
"Mu": "\u039C",
|
"Mu": "\u039C",
|
||||||
"Nu": "\u039D",
|
"Nu": "\u039D",
|
||||||
"Xi": "\u039E",
|
"Xi": "\u039E",
|
||||||
"Omicron": "\u039F",
|
"Omicron": "\u039F",
|
||||||
"Pi": "\u03A0",
|
"Pi": "\u03A0",
|
||||||
"Rho": "\u03A1",
|
"Rho": "\u03A1",
|
||||||
"Sigma": "\u03A3",
|
"Sigma": "\u03A3",
|
||||||
"Tau": "\u03A4",
|
"Tau": "\u03A4",
|
||||||
"Upsilon": "\u03A5",
|
"Upsilon": "\u03A5",
|
||||||
"Phi": "\u03A6",
|
"Phi": "\u03A6",
|
||||||
"Chi": "\u03A7",
|
"Chi": "\u03A7",
|
||||||
"Psi": "\u03A8",
|
"Psi": "\u03A8",
|
||||||
"Omega": "\u03A9",
|
"Omega": "\u03A9",
|
||||||
"alpha": "\u03B1",
|
"alpha": "\u03B1",
|
||||||
"beta": "\u03B2",
|
"beta": "\u03B2",
|
||||||
"gamma": "\u03B3",
|
"gamma": "\u03B3",
|
||||||
"delta": "\u03B4",
|
"delta": "\u03B4",
|
||||||
"epsilon": "\u03B5",
|
"epsilon": "\u03B5",
|
||||||
"zeta": "\u03B6",
|
"zeta": "\u03B6",
|
||||||
"eta": "\u03B7",
|
"eta": "\u03B7",
|
||||||
"theta": "\u03B8",
|
"theta": "\u03B8",
|
||||||
"iota": "\u03B9",
|
"iota": "\u03B9",
|
||||||
"kappa": "\u03BA",
|
"kappa": "\u03BA",
|
||||||
"lambda": "\u03BB",
|
"lambda": "\u03BB",
|
||||||
"mu": "\u03BC",
|
"mu": "\u03BC",
|
||||||
"nu": "\u03BD",
|
"nu": "\u03BD",
|
||||||
"xi": "\u03BE",
|
"xi": "\u03BE",
|
||||||
"omicron": "\u03BF",
|
"omicron": "\u03BF",
|
||||||
"pi": "\u03C0",
|
"pi": "\u03C0",
|
||||||
"rho": "\u03C1",
|
"rho": "\u03C1",
|
||||||
"sigmaf": "\u03C2",
|
"sigmaf": "\u03C2",
|
||||||
"sigma": "\u03C3",
|
"sigma": "\u03C3",
|
||||||
"tau": "\u03C4",
|
"tau": "\u03C4",
|
||||||
"upsilon": "\u03C5",
|
"upsilon": "\u03C5",
|
||||||
"phi": "\u03C6",
|
"phi": "\u03C6",
|
||||||
"chi": "\u03C7",
|
"chi": "\u03C7",
|
||||||
"psi": "\u03C8",
|
"psi": "\u03C8",
|
||||||
"omega": "\u03C9",
|
"omega": "\u03C9",
|
||||||
"thetasym": "\u03D1",
|
"thetasym": "\u03D1",
|
||||||
"upsih": "\u03D2",
|
"upsih": "\u03D2",
|
||||||
"piv": "\u03D6",
|
"piv": "\u03D6",
|
||||||
"bull": "\u2022",
|
"bull": "\u2022",
|
||||||
"hellip": "\u2026",
|
"hellip": "\u2026",
|
||||||
"prime": "\u2032",
|
"prime": "\u2032",
|
||||||
"Prime": "\u2033",
|
"Prime": "\u2033",
|
||||||
"oline": "\u203E",
|
"oline": "\u203E",
|
||||||
"frasl": "\u2044",
|
"frasl": "\u2044",
|
||||||
"weierp": "\u2118",
|
"weierp": "\u2118",
|
||||||
"image": "\u2111",
|
"image": "\u2111",
|
||||||
"real": "\u211C",
|
"real": "\u211C",
|
||||||
"trade": "\u2122",
|
"trade": "\u2122",
|
||||||
"alefsym": "\u2135",
|
"alefsym": "\u2135",
|
||||||
"larr": "\u2190",
|
"larr": "\u2190",
|
||||||
"uarr": "\u2191",
|
"uarr": "\u2191",
|
||||||
"rarr": "\u2192",
|
"rarr": "\u2192",
|
||||||
"darr": "\u2193",
|
"darr": "\u2193",
|
||||||
"harr": "\u2194",
|
"harr": "\u2194",
|
||||||
"crarr": "\u21B5",
|
"crarr": "\u21B5",
|
||||||
"lArr": "\u21D0",
|
"lArr": "\u21D0",
|
||||||
"uArr": "\u21D1",
|
"uArr": "\u21D1",
|
||||||
"rArr": "\u21D2",
|
"rArr": "\u21D2",
|
||||||
"dArr": "\u21D3",
|
"dArr": "\u21D3",
|
||||||
"hArr": "\u21D4",
|
"hArr": "\u21D4",
|
||||||
"forall": "\u2200",
|
"forall": "\u2200",
|
||||||
"part": "\u2202",
|
"part": "\u2202",
|
||||||
"exist": "\u2203",
|
"exist": "\u2203",
|
||||||
"empty": "\u2205",
|
"empty": "\u2205",
|
||||||
"nabla": "\u2207",
|
"nabla": "\u2207",
|
||||||
"isin": "\u2208",
|
"isin": "\u2208",
|
||||||
"notin": "\u2209",
|
"notin": "\u2209",
|
||||||
"ni": "\u220B",
|
"ni": "\u220B",
|
||||||
"prod": "\u220F",
|
"prod": "\u220F",
|
||||||
"sum": "\u2211",
|
"sum": "\u2211",
|
||||||
"minus": "\u2212",
|
"minus": "\u2212",
|
||||||
"lowast": "\u2217",
|
"lowast": "\u2217",
|
||||||
"radic": "\u221A",
|
"radic": "\u221A",
|
||||||
"prop": "\u221D",
|
"prop": "\u221D",
|
||||||
"infin": "\u221E",
|
"infin": "\u221E",
|
||||||
"ang": "\u2220",
|
"ang": "\u2220",
|
||||||
"and": "\u2227",
|
"and": "\u2227",
|
||||||
"or": "\u2228",
|
"or": "\u2228",
|
||||||
"cap": "\u2229",
|
"cap": "\u2229",
|
||||||
"cup": "\u222A",
|
"cup": "\u222A",
|
||||||
"int": "\u222B",
|
"int": "\u222B",
|
||||||
"there4": "\u2234",
|
"there4": "\u2234",
|
||||||
"sim": "\u223C",
|
"sim": "\u223C",
|
||||||
"cong": "\u2245",
|
"cong": "\u2245",
|
||||||
"asymp": "\u2248",
|
"asymp": "\u2248",
|
||||||
"ne": "\u2260",
|
"ne": "\u2260",
|
||||||
"equiv": "\u2261",
|
"equiv": "\u2261",
|
||||||
"le": "\u2264",
|
"le": "\u2264",
|
||||||
"ge": "\u2265",
|
"ge": "\u2265",
|
||||||
"sub": "\u2282",
|
"sub": "\u2282",
|
||||||
"sup": "\u2283",
|
"sup": "\u2283",
|
||||||
"nsub": "\u2284",
|
"nsub": "\u2284",
|
||||||
"sube": "\u2286",
|
"sube": "\u2286",
|
||||||
"supe": "\u2287",
|
"supe": "\u2287",
|
||||||
"oplus": "\u2295",
|
"oplus": "\u2295",
|
||||||
"otimes": "\u2297",
|
"otimes": "\u2297",
|
||||||
"perp": "\u22A5",
|
"perp": "\u22A5",
|
||||||
"sdot": "\u22C5",
|
"sdot": "\u22C5",
|
||||||
"lceil": "\u2308",
|
"lceil": "\u2308",
|
||||||
"rceil": "\u2309",
|
"rceil": "\u2309",
|
||||||
"lfloor": "\u230A",
|
"lfloor": "\u230A",
|
||||||
"rfloor": "\u230B",
|
"rfloor": "\u230B",
|
||||||
"lang": "\u2329",
|
"lang": "\u2329",
|
||||||
"rang": "\u232A",
|
"rang": "\u232A",
|
||||||
"loz": "\u25CA",
|
"loz": "\u25CA",
|
||||||
"spades": "\u2660",
|
"spades": "\u2660",
|
||||||
"clubs": "\u2663",
|
"clubs": "\u2663",
|
||||||
"hearts": "\u2665",
|
"hearts": "\u2665",
|
||||||
"diams": "\u2666",
|
"diams": "\u2666",
|
||||||
"quot": "\u0022",
|
"quot": "\u0022",
|
||||||
"amp": "\u0026",
|
"amp": "\u0026",
|
||||||
"lt": "\u003C",
|
"lt": "\u003C",
|
||||||
"gt": "\u003E",
|
"gt": "\u003E",
|
||||||
"OElig": "\u0152",
|
"OElig": "\u0152",
|
||||||
"oelig": "\u0153",
|
"oelig": "\u0153",
|
||||||
"Scaron": "\u0160",
|
"Scaron": "\u0160",
|
||||||
"scaron": "\u0161",
|
"scaron": "\u0161",
|
||||||
"Yuml": "\u0178",
|
"Yuml": "\u0178",
|
||||||
"circ": "\u02C6",
|
"circ": "\u02C6",
|
||||||
"tilde": "\u02DC",
|
"tilde": "\u02DC",
|
||||||
"ensp": "\u2002",
|
"ensp": "\u2002",
|
||||||
"emsp": "\u2003",
|
"emsp": "\u2003",
|
||||||
"thinsp": "\u2009",
|
"thinsp": "\u2009",
|
||||||
"zwnj": "\u200C",
|
"zwnj": "\u200C",
|
||||||
"zwj": "\u200D",
|
"zwj": "\u200D",
|
||||||
"lrm": "\u200E",
|
"lrm": "\u200E",
|
||||||
"rlm": "\u200F",
|
"rlm": "\u200F",
|
||||||
"ndash": "\u2013",
|
"ndash": "\u2013",
|
||||||
"mdash": "\u2014",
|
"mdash": "\u2014",
|
||||||
"lsquo": "\u2018",
|
"lsquo": "\u2018",
|
||||||
"rsquo": "\u2019",
|
"rsquo": "\u2019",
|
||||||
"sbquo": "\u201A",
|
"sbquo": "\u201A",
|
||||||
"ldquo": "\u201C",
|
"ldquo": "\u201C",
|
||||||
"rdquo": "\u201D",
|
"rdquo": "\u201D",
|
||||||
"bdquo": "\u201E",
|
"bdquo": "\u201E",
|
||||||
"dagger": "\u2020",
|
"dagger": "\u2020",
|
||||||
"Dagger": "\u2021",
|
"Dagger": "\u2021",
|
||||||
"permil": "\u2030",
|
"permil": "\u2030",
|
||||||
"lsaquo": "\u2039",
|
"lsaquo": "\u2039",
|
||||||
"rsaquo": "\u203A",
|
"rsaquo": "\u203A",
|
||||||
"euro": "\u20AC",
|
"euro": "\u20AC",
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTMLAutoClose is the set of HTML elements that
|
// HTMLAutoClose is the set of HTML elements that
|
||||||
|
|
|
||||||
|
|
@ -238,25 +238,25 @@ type allScalars struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
var all = allScalars{
|
var all = allScalars{
|
||||||
True1: true,
|
True1: true,
|
||||||
True2: true,
|
True2: true,
|
||||||
False1: false,
|
False1: false,
|
||||||
False2: false,
|
False2: false,
|
||||||
Int: 1,
|
Int: 1,
|
||||||
Int8: -2,
|
Int8: -2,
|
||||||
Int16: 3,
|
Int16: 3,
|
||||||
Int32: -4,
|
Int32: -4,
|
||||||
Int64: 5,
|
Int64: 5,
|
||||||
Uint: 6,
|
Uint: 6,
|
||||||
Uint8: 7,
|
Uint8: 7,
|
||||||
Uint16: 8,
|
Uint16: 8,
|
||||||
Uint32: 9,
|
Uint32: 9,
|
||||||
Uint64: 10,
|
Uint64: 10,
|
||||||
Uintptr: 11,
|
Uintptr: 11,
|
||||||
Float: 12.0,
|
Float: 12.0,
|
||||||
Float32: 13.0,
|
Float32: 13.0,
|
||||||
Float64: 14.0,
|
Float64: 14.0,
|
||||||
String: "15",
|
String: "15",
|
||||||
}
|
}
|
||||||
|
|
||||||
const testScalarsInput = `<allscalars>
|
const testScalarsInput = `<allscalars>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue