From 9c63abc9a1d127f95162756467284cf76b47aff8 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 7 Dec 2011 01:11:29 +0000 Subject: [PATCH] libgo: Update to weekly 2011-11-09. From-SVN: r182073 --- gcc/testsuite/go.test/test/chan/select5.go | 2 +- gcc/testsuite/go.test/test/cmplxdivide.go | 14 +- .../go.test/test/fixedbugs/bug358.go | 2 +- gcc/testsuite/go.test/test/ken/divconst.go | 2 +- gcc/testsuite/go.test/test/ken/modconst.go | 2 +- gcc/testsuite/go.test/test/mallocrand.go | 2 +- gcc/testsuite/go.test/test/stringrange.go | 15 +- gcc/testsuite/go.test/test/utf.go | 32 +- libgo/MERGE | 2 +- libgo/Makefile.am | 1163 ++++++------ libgo/Makefile.in | 1586 +++++++++-------- libgo/go/archive/tar/reader.go | 4 +- libgo/go/archive/zip/reader.go | 3 +- libgo/go/archive/zip/reader_test.go | 6 +- libgo/go/archive/zip/writer_test.go | 2 +- libgo/go/bufio/bufio.go | 13 +- libgo/go/bufio/bufio_test.go | 13 +- libgo/go/builtin/builtin.go | 92 +- libgo/go/bytes/buffer.go | 14 +- libgo/go/bytes/buffer_test.go | 4 +- libgo/go/bytes/bytes.go | 7 +- libgo/go/bytes/bytes_test.go | 2 +- libgo/go/compress/bzip2/bit_reader.go | 4 +- libgo/go/compress/bzip2/bzip2.go | 4 +- libgo/go/compress/zlib/testdata/e.txt | 1 - libgo/go/compress/zlib/testdata/pi.txt | 1 - libgo/go/container/heap/heap.go | 9 +- libgo/go/container/heap/heap_test.go | 2 +- libgo/go/crypto/dsa/dsa.go | 2 +- libgo/go/crypto/dsa/dsa_test.go | 2 +- libgo/go/crypto/ecdsa/ecdsa.go | 2 +- libgo/go/crypto/ecdsa/ecdsa_test.go | 4 +- libgo/go/crypto/elliptic/elliptic.go | 2 +- libgo/go/crypto/elliptic/elliptic_test.go | 2 +- libgo/go/crypto/hmac/hmac_test.go | 2 +- libgo/go/crypto/ocsp/ocsp.go | 2 +- libgo/go/crypto/openpgp/armor/armor.go | 2 +- libgo/go/crypto/openpgp/elgamal/elgamal.go | 2 +- .../go/crypto/openpgp/elgamal/elgamal_test.go | 2 +- .../go/crypto/openpgp/packet/encrypted_key.go | 2 +- .../openpgp/packet/encrypted_key_test.go | 2 +- libgo/go/crypto/openpgp/packet/packet.go | 2 +- libgo/go/crypto/openpgp/packet/private_key.go | 2 +- libgo/go/crypto/openpgp/packet/public_key.go | 2 +- libgo/go/crypto/openpgp/s2k/s2k_test.go | 2 +- libgo/go/crypto/rand/util.go | 2 +- libgo/go/crypto/rsa/pkcs1v15.go | 2 +- libgo/go/crypto/rsa/pkcs1v15_test.go | 2 +- libgo/go/crypto/rsa/rsa.go | 2 +- libgo/go/crypto/rsa/rsa_test.go | 2 +- libgo/go/crypto/tls/conn.go | 2 +- libgo/go/crypto/tls/generate_cert.go | 4 +- .../go/crypto/tls/handshake_messages_test.go | 2 +- libgo/go/crypto/tls/handshake_server_test.go | 2 +- libgo/go/crypto/tls/key_agreement.go | 2 +- libgo/go/crypto/x509/pkcs1.go | 6 +- libgo/go/crypto/x509/pkix/pkix.go | 4 +- libgo/go/crypto/x509/x509.go | 4 +- libgo/go/crypto/x509/x509_test.go | 4 +- libgo/go/debug/gosym/pclntab_test.go | 2 +- libgo/go/{ => encoding}/asn1/asn1.go | 2 +- libgo/go/{ => encoding}/asn1/asn1_test.go | 0 libgo/go/{ => encoding}/asn1/common.go | 0 libgo/go/{ => encoding}/asn1/marshal.go | 2 +- libgo/go/{ => encoding}/asn1/marshal_test.go | 0 libgo/go/encoding/binary/binary.go | 2 +- libgo/go/encoding/binary/binary_test.go | 1 - libgo/go/{ => encoding}/csv/reader.go | 0 libgo/go/{ => encoding}/csv/reader_test.go | 0 libgo/go/{ => encoding}/csv/writer.go | 2 +- libgo/go/{ => encoding}/csv/writer_test.go | 0 libgo/go/{ => encoding}/gob/codec_test.go | 0 libgo/go/encoding/gob/debug.go | 687 +++++++ libgo/go/{ => encoding}/gob/decode.go | 0 libgo/go/{ => encoding}/gob/decoder.go | 0 libgo/go/{ => encoding}/gob/doc.go | 0 libgo/go/encoding/gob/dump.go | 22 + libgo/go/{ => encoding}/gob/encode.go | 0 libgo/go/{ => encoding}/gob/encoder.go | 0 libgo/go/{ => encoding}/gob/encoder_test.go | 0 libgo/go/{ => encoding}/gob/error.go | 0 libgo/go/{ => encoding}/gob/gobencdec_test.go | 0 libgo/go/{ => encoding}/gob/timing_test.go | 0 libgo/go/{ => encoding}/gob/type.go | 17 +- libgo/go/{ => encoding}/gob/type_test.go | 8 + libgo/go/{ => encoding}/json/decode.go | 4 +- libgo/go/{ => encoding}/json/decode_test.go | 0 libgo/go/{ => encoding}/json/encode.go | 2 +- libgo/go/{ => encoding}/json/encode_test.go | 0 libgo/go/{ => encoding}/json/indent.go | 0 libgo/go/{ => encoding}/json/scanner.go | 0 libgo/go/{ => encoding}/json/scanner_test.go | 4 +- libgo/go/{ => encoding}/json/stream.go | 0 libgo/go/{ => encoding}/json/stream_test.go | 0 libgo/go/{ => encoding}/json/tagkey_test.go | 0 libgo/go/{ => encoding}/json/tags.go | 0 libgo/go/{ => encoding}/json/tags_test.go | 0 libgo/go/{ => encoding}/xml/atom_test.go | 0 libgo/go/{ => encoding}/xml/embed_test.go | 0 libgo/go/{ => encoding}/xml/marshal.go | 0 libgo/go/{ => encoding}/xml/marshal_test.go | 6 +- libgo/go/{ => encoding}/xml/read.go | 8 +- libgo/go/{ => encoding}/xml/read_test.go | 9 + libgo/go/{ => encoding}/xml/xml.go | 4 +- libgo/go/{ => encoding}/xml/xml_test.go | 6 +- libgo/go/exp/ebnf/ebnf.go | 4 +- libgo/go/exp/ebnf/parser.go | 2 +- libgo/go/exp/norm/composition.go | 2 +- libgo/go/exp/norm/input.go | 2 +- libgo/go/exp/norm/maketables.go | 2 +- libgo/go/exp/norm/normalize.go | 2 +- libgo/go/exp/norm/normregtest.go | 4 +- libgo/go/exp/norm/trie_test.go | 2 +- libgo/go/exp/norm/triegen.go | 2 +- libgo/go/exp/spdy/read.go | 2 +- libgo/go/exp/spdy/spdy_test.go | 2 +- libgo/go/exp/spdy/types.go | 2 +- libgo/go/exp/spdy/write.go | 2 +- libgo/go/exp/sql/convert.go | 71 +- libgo/go/exp/sql/convert_test.go | 52 + libgo/go/exp/sql/driver/driver.go | 14 +- libgo/go/exp/sql/driver/types.go | 62 +- libgo/go/exp/sql/driver/types_test.go | 57 + libgo/go/exp/sql/fakedb_test.go | 2 +- libgo/go/exp/sql/sql.go | 266 ++- libgo/go/exp/ssh/client.go | 57 +- libgo/go/exp/ssh/client_auth.go | 157 ++ libgo/go/exp/ssh/common.go | 2 +- libgo/go/exp/ssh/doc.go | 2 +- libgo/go/exp/ssh/messages.go | 2 +- libgo/go/exp/ssh/messages_test.go | 4 +- libgo/go/exp/ssh/server.go | 2 +- libgo/go/exp/types/const.go | 4 +- libgo/go/exp/types/gcimporter.go | 4 +- libgo/go/exp/types/gcimporter_test.go | 2 +- libgo/go/exp/wingui/gui.go | 2 +- libgo/go/exp/wingui/winapi.go | 2 +- libgo/go/expvar/expvar.go | 4 +- libgo/go/expvar/expvar_test.go | 2 +- libgo/go/fmt/format.go | 2 +- libgo/go/fmt/print.go | 2 +- libgo/go/fmt/scan.go | 4 +- libgo/go/fmt/scan_test.go | 2 +- libgo/go/go/ast/ast.go | 2 +- libgo/go/go/ast/import.go | 139 ++ libgo/go/go/build/build.go | 2 +- libgo/go/go/build/build_test.go | 2 +- libgo/go/go/doc/comment.go | 2 +- libgo/go/go/doc/example.go | 2 +- libgo/go/go/parser/parser.go | 2 +- libgo/go/go/printer/printer.go | 2 +- libgo/go/go/scanner/scanner.go | 2 +- libgo/go/go/token/serialize.go | 2 +- libgo/go/html/doc.go | 4 +- libgo/go/html/entity_test.go | 2 +- libgo/go/html/escape.go | 2 +- libgo/go/html/parse.go | 68 +- libgo/go/html/parse_test.go | 40 +- .../template/html => html/template}/attr.go | 2 +- .../template/html => html/template}/clone.go | 4 +- .../html => html/template}/clone_test.go | 8 +- .../html => html/template}/content.go | 2 +- .../html => html/template}/content_test.go | 5 +- .../html => html/template}/context.go | 2 +- .../template/html => html/template}/css.go | 4 +- .../html => html/template}/css_test.go | 2 +- .../template/html => html/template}/doc.go | 62 +- .../template/html => html/template}/error.go | 66 +- .../template/html => html/template}/escape.go | 32 +- .../html => html/template}/escape_test.go | 78 +- .../template/html => html/template}/html.go | 4 +- .../html => html/template}/html_test.go | 2 +- .../template/html => html/template}/js.go | 6 +- .../html => html/template}/js_test.go | 2 +- libgo/go/html/template/template.go | 239 +++ .../html => html/template}/transition.go | 2 +- .../template/html => html/template}/url.go | 2 +- .../html => html/template}/url_test.go | 2 +- ...pending-spec-changes-plain-text-unsafe.dat | Bin 0 -> 115 bytes libgo/go/html/token.go | 8 +- libgo/go/html/token_test.go | 10 +- libgo/go/http/dump.go | 77 - libgo/go/image/bmp/reader.go | 2 +- libgo/go/image/jpeg/writer_test.go | 2 +- .../go/index/suffixarray/suffixarray_test.go | 2 +- libgo/go/io/multi_test.go | 2 +- libgo/go/log/log.go | 4 +- libgo/go/{ => log}/syslog/syslog.go | 0 libgo/go/{ => log}/syslog/syslog_c.c | 0 libgo/go/{ => log}/syslog/syslog_libc.go | 0 libgo/go/{ => log}/syslog/syslog_test.go | 0 libgo/go/{ => log}/syslog/syslog_unix.go | 0 libgo/go/math/all_test.go | 72 +- libgo/go/{ => math}/big/arith.go | 0 libgo/go/{ => math}/big/arith_decl.go | 0 libgo/go/{ => math}/big/arith_test.go | 0 libgo/go/{ => math}/big/calibrate_test.go | 0 libgo/go/{ => math}/big/hilbert_test.go | 0 libgo/go/{ => math}/big/int.go | 4 +- libgo/go/{ => math}/big/int_test.go | 2 +- libgo/go/{ => math}/big/nat.go | 2 +- libgo/go/{ => math}/big/nat_test.go | 0 libgo/go/{ => math}/big/rat.go | 0 libgo/go/{ => math}/big/rat_test.go | 2 +- libgo/go/{cmath => math/cmplx}/abs.go | 4 +- libgo/go/{cmath => math/cmplx}/asin.go | 2 +- libgo/go/{cmath => math/cmplx}/cmath_test.go | 2 +- libgo/go/{cmath => math/cmplx}/conj.go | 2 +- libgo/go/{cmath => math/cmplx}/exp.go | 2 +- libgo/go/{cmath => math/cmplx}/isinf.go | 2 +- libgo/go/{cmath => math/cmplx}/isnan.go | 2 +- libgo/go/{cmath => math/cmplx}/log.go | 2 +- libgo/go/{cmath => math/cmplx}/phase.go | 2 +- libgo/go/{cmath => math/cmplx}/polar.go | 2 +- libgo/go/{cmath => math/cmplx}/pow.go | 2 +- libgo/go/{cmath => math/cmplx}/rect.go | 2 +- libgo/go/{cmath => math/cmplx}/sin.go | 2 +- libgo/go/{cmath => math/cmplx}/sqrt.go | 2 +- libgo/go/{cmath => math/cmplx}/tan.go | 2 +- libgo/go/math/gamma.go | 6 +- libgo/go/{ => math}/rand/exp.go | 0 libgo/go/{ => math}/rand/normal.go | 0 libgo/go/{ => math}/rand/rand.go | 0 libgo/go/{ => math}/rand/rand_test.go | 2 +- libgo/go/{ => math}/rand/rng.go | 0 libgo/go/{ => math}/rand/zipf.go | 0 libgo/go/math/tan.go | 148 +- libgo/go/mime/multipart/multipart.go | 2 +- libgo/go/mime/multipart/multipart_test.go | 6 +- libgo/go/net/dnsclient.go | 2 +- libgo/go/net/dnsclient_unix.go | 2 +- libgo/go/{ => net}/http/cgi/child.go | 4 +- libgo/go/{ => net}/http/cgi/child_test.go | 0 libgo/go/{ => net}/http/cgi/host.go | 4 +- libgo/go/{ => net}/http/cgi/host_test.go | 17 +- .../go/{ => net}/http/cgi/matryoshka_test.go | 2 +- libgo/go/{ => net}/http/cgi/testdata/test.cgi | 0 libgo/go/net/http/chunked.go | 57 + libgo/go/{ => net}/http/client.go | 4 +- libgo/go/{ => net}/http/client_test.go | 6 +- libgo/go/{ => net}/http/cookie.go | 0 libgo/go/{ => net}/http/cookie_test.go | 2 +- libgo/go/{ => net}/http/doc.go | 0 libgo/go/{ => net}/http/export_test.go | 0 libgo/go/{ => net}/http/fcgi/child.go | 4 +- libgo/go/{ => net}/http/fcgi/fcgi.go | 0 libgo/go/{ => net}/http/fcgi/fcgi_test.go | 0 libgo/go/{ => net}/http/filetransport.go | 0 libgo/go/{ => net}/http/filetransport_test.go | 2 +- libgo/go/{ => net}/http/fs.go | 2 +- libgo/go/{ => net}/http/fs_test.go | 6 +- libgo/go/{ => net}/http/header.go | 4 +- libgo/go/{ => net}/http/header_test.go | 0 libgo/go/{ => net}/http/httptest/recorder.go | 2 +- libgo/go/{ => net}/http/httptest/server.go | 2 +- .../go/{http => net/http/httputil}/chunked.go | 24 +- libgo/go/net/http/httputil/chunked_test.go | 35 + libgo/go/net/http/httputil/dump.go | 203 +++ libgo/go/net/http/httputil/dump_test.go | 140 ++ .../go/{http => net/http/httputil}/persist.go | 43 +- .../http/httputil}/reverseproxy.go | 29 +- .../http/httputil}/reverseproxy_test.go | 16 +- libgo/go/{ => net}/http/lex.go | 0 libgo/go/{ => net}/http/lex_test.go | 0 libgo/go/{ => net}/http/pprof/pprof.go | 2 +- libgo/go/{ => net}/http/proxy_test.go | 0 libgo/go/{ => net}/http/range_test.go | 0 libgo/go/{ => net}/http/readrequest_test.go | 59 +- libgo/go/{ => net}/http/request.go | 98 +- libgo/go/{ => net}/http/request_test.go | 25 +- libgo/go/{ => net}/http/requestwrite_test.go | 28 +- libgo/go/{ => net}/http/response.go | 2 +- libgo/go/{ => net}/http/response_test.go | 2 +- libgo/go/{ => net}/http/responsewrite_test.go | 0 libgo/go/{ => net}/http/serve_test.go | 11 +- libgo/go/{ => net}/http/server.go | 2 +- libgo/go/{ => net}/http/sniff.go | 4 +- libgo/go/{ => net}/http/sniff_test.go | 5 +- libgo/go/{ => net}/http/status.go | 0 libgo/go/{ => net}/http/testdata/file | 0 libgo/go/{ => net}/http/testdata/index.html | 0 libgo/go/{ => net}/http/testdata/style.css | 0 libgo/go/{ => net}/http/transfer.go | 79 +- libgo/go/{ => net}/http/transport.go | 56 +- libgo/go/{ => net}/http/transport_test.go | 6 +- libgo/go/{ => net}/http/transport_windows.go | 2 +- libgo/go/net/http/triv.go | 149 ++ libgo/go/net/ip_test.go | 2 +- libgo/go/net/lookup_test.go | 4 - libgo/go/net/lookup_windows.go | 29 +- libgo/go/{ => net}/mail/message.go | 0 libgo/go/{ => net}/mail/message_test.go | 0 libgo/go/net/net_test.go | 2 +- libgo/go/net/parse_test.go | 2 +- libgo/go/{ => net}/rpc/client.go | 4 +- libgo/go/{ => net}/rpc/debug.go | 4 +- libgo/go/{ => net}/rpc/jsonrpc/all_test.go | 4 +- libgo/go/{ => net}/rpc/jsonrpc/client.go | 4 +- libgo/go/{ => net}/rpc/jsonrpc/server.go | 4 +- libgo/go/{ => net}/rpc/server.go | 6 +- libgo/go/{ => net}/rpc/server_test.go | 2 +- libgo/go/net/server_test.go | 2 +- libgo/go/{ => net}/smtp/auth.go | 0 libgo/go/{ => net}/smtp/smtp.go | 0 libgo/go/{ => net}/smtp/smtp_test.go | 0 libgo/go/net/sock_bsd.go | 2 +- libgo/go/net/textproto/reader.go | 2 +- libgo/go/{ => net}/url/url.go | 0 libgo/go/{ => net}/url/url_test.go | 0 libgo/go/old/netchan/common.go | 2 +- libgo/go/old/netchan/export.go | 2 +- libgo/go/old/regexp/regexp.go | 2 +- libgo/go/old/template/parse.go | 2 +- libgo/go/old/template/template_test.go | 2 +- libgo/go/os/dir_unix.go | 2 +- libgo/go/os/env_plan9.go | 2 +- libgo/go/os/env_windows.go | 2 +- libgo/go/os/error_plan9.go | 2 +- libgo/go/{ => os}/exec/exec.go | 0 libgo/go/{ => os}/exec/exec_test.go | 2 +- libgo/go/{ => os}/exec/lp_plan9.go | 0 libgo/go/{ => os}/exec/lp_test.go | 0 libgo/go/{ => os}/exec/lp_unix.go | 0 libgo/go/{ => os}/exec/lp_windows.go | 0 libgo/go/os/exec_plan9.go | 3 +- libgo/go/os/file_unix.go | 6 +- libgo/go/os/path_test.go | 2 +- libgo/go/path/filepath/match.go | 2 +- libgo/go/path/filepath/match_test.go | 2 +- libgo/go/path/match.go | 2 +- libgo/go/regexp/exec_test.go | 4 +- libgo/go/regexp/regexp.go | 2 +- libgo/go/regexp/syntax/parse.go | 2 +- .../go/regexp/testdata/re2-exhaustive.txt.bz2 | Bin 0 -> 394016 bytes libgo/go/runtime/export_test.go | 1 + libgo/go/runtime/softfloat64_test.go | 2 +- libgo/go/sort/sort_test.go | 2 +- libgo/go/strconv/quote.go | 2 +- libgo/go/strings/reader.go | 4 +- libgo/go/strings/strings.go | 2 +- libgo/go/strings/strings_test.go | 2 +- libgo/go/sync/once_test.go | 2 +- libgo/go/testing/quick/quick.go | 2 +- libgo/go/testing/quick/quick_test.go | 2 +- libgo/go/testing/script/script.go | 2 +- libgo/go/{ => text}/scanner/scanner.go | 4 +- libgo/go/{ => text}/scanner/scanner_test.go | 2 +- libgo/go/{ => text}/tabwriter/tabwriter.go | 2 +- .../go/{ => text}/tabwriter/tabwriter_test.go | 0 libgo/go/{ => text}/template/doc.go | 0 libgo/go/{ => text}/template/exec.go | 8 +- libgo/go/{ => text}/template/exec_test.go | 25 + libgo/go/{ => text}/template/funcs.go | 6 +- libgo/go/{ => text}/template/helper.go | 0 libgo/go/{ => text}/template/parse.go | 17 +- libgo/go/{ => text}/template/parse/lex.go | 2 +- .../go/{ => text}/template/parse/lex_test.go | 0 libgo/go/{ => text}/template/parse/node.go | 0 libgo/go/{ => text}/template/parse/parse.go | 0 .../{ => text}/template/parse/parse_test.go | 0 libgo/go/{ => text}/template/parse/set.go | 0 libgo/go/{ => text}/template/set.go | 11 +- libgo/go/{ => text}/template/set_test.go | 0 .../{ => text}/template/testdata/file1.tmpl | 0 .../{ => text}/template/testdata/file2.tmpl | 0 .../{ => text}/template/testdata/tmpl1.tmpl | 0 .../{ => text}/template/testdata/tmpl2.tmpl | 0 libgo/go/time/sleep_test.go | 4 +- libgo/go/time/sys.go | 18 +- libgo/go/time/zoneinfo_windows.go | 4 +- libgo/go/{ => unicode}/utf16/utf16.go | 0 libgo/go/{ => unicode}/utf16/utf16_test.go | 2 +- libgo/go/{ => unicode}/utf8/string.go | 0 libgo/go/{ => unicode}/utf8/string_test.go | 4 +- libgo/go/{ => unicode}/utf8/utf8.go | 0 libgo/go/{ => unicode}/utf8/utf8_test.go | 2 +- libgo/go/websocket/client.go | 2 +- libgo/go/websocket/hixie.go | 6 +- libgo/go/websocket/hixie_test.go | 4 +- libgo/go/websocket/hybi.go | 4 +- libgo/go/websocket/hybi_test.go | 4 +- libgo/go/websocket/server.go | 8 +- libgo/go/websocket/websocket.go | 6 +- libgo/go/websocket/websocket_test.go | 29 +- libgo/merge.sh | 2 +- libgo/runtime/time.goc | 13 + 386 files changed, 4963 insertions(+), 2370 deletions(-) delete mode 100644 libgo/go/compress/zlib/testdata/e.txt delete mode 100644 libgo/go/compress/zlib/testdata/pi.txt rename libgo/go/{ => encoding}/asn1/asn1.go (99%) rename libgo/go/{ => encoding}/asn1/asn1_test.go (100%) rename libgo/go/{ => encoding}/asn1/common.go (100%) rename libgo/go/{ => encoding}/asn1/marshal.go (99%) rename libgo/go/{ => encoding}/asn1/marshal_test.go (100%) rename libgo/go/{ => encoding}/csv/reader.go (100%) rename libgo/go/{ => encoding}/csv/reader_test.go (100%) rename libgo/go/{ => encoding}/csv/writer.go (99%) rename libgo/go/{ => encoding}/csv/writer_test.go (100%) rename libgo/go/{ => encoding}/gob/codec_test.go (100%) create mode 100644 libgo/go/encoding/gob/debug.go rename libgo/go/{ => encoding}/gob/decode.go (100%) rename libgo/go/{ => encoding}/gob/decoder.go (100%) rename libgo/go/{ => encoding}/gob/doc.go (100%) create mode 100644 libgo/go/encoding/gob/dump.go rename libgo/go/{ => encoding}/gob/encode.go (100%) rename libgo/go/{ => encoding}/gob/encoder.go (100%) rename libgo/go/{ => encoding}/gob/encoder_test.go (100%) rename libgo/go/{ => encoding}/gob/error.go (100%) rename libgo/go/{ => encoding}/gob/gobencdec_test.go (100%) rename libgo/go/{ => encoding}/gob/timing_test.go (100%) rename libgo/go/{ => encoding}/gob/type.go (97%) rename libgo/go/{ => encoding}/gob/type_test.go (95%) rename libgo/go/{ => encoding}/json/decode.go (99%) rename libgo/go/{ => encoding}/json/decode_test.go (100%) rename libgo/go/{ => encoding}/json/encode.go (99%) rename libgo/go/{ => encoding}/json/encode_test.go (100%) rename libgo/go/{ => encoding}/json/indent.go (100%) rename libgo/go/{ => encoding}/json/scanner.go (100%) rename libgo/go/{ => encoding}/json/scanner_test.go (99%) rename libgo/go/{ => encoding}/json/stream.go (100%) rename libgo/go/{ => encoding}/json/stream_test.go (100%) rename libgo/go/{ => encoding}/json/tagkey_test.go (100%) rename libgo/go/{ => encoding}/json/tags.go (100%) rename libgo/go/{ => encoding}/json/tags_test.go (100%) rename libgo/go/{ => encoding}/xml/atom_test.go (100%) rename libgo/go/{ => encoding}/xml/embed_test.go (100%) rename libgo/go/{ => encoding}/xml/marshal.go (100%) rename libgo/go/{ => encoding}/xml/marshal_test.go (100%) rename libgo/go/{ => encoding}/xml/read.go (99%) rename libgo/go/{ => encoding}/xml/read_test.go (98%) rename libgo/go/{ => encoding}/xml/xml.go (99%) rename libgo/go/{ => encoding}/xml/xml_test.go (98%) create mode 100644 libgo/go/exp/sql/driver/types_test.go create mode 100644 libgo/go/exp/ssh/client_auth.go create mode 100644 libgo/go/go/ast/import.go rename libgo/go/{exp/template/html => html/template}/attr.go (99%) rename libgo/go/{exp/template/html => html/template}/clone.go (98%) rename libgo/go/{exp/template/html => html/template}/clone_test.go (96%) rename libgo/go/{exp/template/html => html/template}/content.go (99%) rename libgo/go/{exp/template/html => html/template}/content_test.go (98%) rename libgo/go/{exp/template/html => html/template}/context.go (99%) rename libgo/go/{exp/template/html => html/template}/css.go (99%) rename libgo/go/{exp/template/html => html/template}/css_test.go (99%) rename libgo/go/{exp/template/html => html/template}/doc.go (71%) rename libgo/go/{exp/template/html => html/template}/error.go (75%) rename libgo/go/{exp/template/html => html/template}/escape.go (96%) rename libgo/go/{exp/template/html => html/template}/escape_test.go (96%) rename libgo/go/{exp/template/html => html/template}/html.go (99%) rename libgo/go/{exp/template/html => html/template}/html_test.go (99%) rename libgo/go/{exp/template/html => html/template}/js.go (99%) rename libgo/go/{exp/template/html => html/template}/js_test.go (99%) create mode 100644 libgo/go/html/template/template.go rename libgo/go/{exp/template/html => html/template}/transition.go (99%) rename libgo/go/{exp/template/html => html/template}/url.go (99%) rename libgo/go/{exp/template/html => html/template}/url_test.go (99%) create mode 100644 libgo/go/html/testdata/webkit/pending-spec-changes-plain-text-unsafe.dat delete mode 100644 libgo/go/http/dump.go rename libgo/go/{ => log}/syslog/syslog.go (100%) rename libgo/go/{ => log}/syslog/syslog_c.c (100%) rename libgo/go/{ => log}/syslog/syslog_libc.go (100%) rename libgo/go/{ => log}/syslog/syslog_test.go (100%) rename libgo/go/{ => log}/syslog/syslog_unix.go (100%) rename libgo/go/{ => math}/big/arith.go (100%) rename libgo/go/{ => math}/big/arith_decl.go (100%) rename libgo/go/{ => math}/big/arith_test.go (100%) rename libgo/go/{ => math}/big/calibrate_test.go (100%) rename libgo/go/{ => math}/big/hilbert_test.go (100%) rename libgo/go/{ => math}/big/int.go (99%) rename libgo/go/{ => math}/big/int_test.go (99%) rename libgo/go/{ => math}/big/nat.go (99%) rename libgo/go/{ => math}/big/nat_test.go (100%) rename libgo/go/{ => math}/big/rat.go (100%) rename libgo/go/{ => math}/big/rat_test.go (99%) rename libgo/go/{cmath => math/cmplx}/abs.go (81%) rename libgo/go/{cmath => math/cmplx}/asin.go (99%) rename libgo/go/{cmath => math/cmplx}/cmath_test.go (99%) rename libgo/go/{cmath => math/cmplx}/conj.go (95%) rename libgo/go/{cmath => math/cmplx}/exp.go (99%) rename libgo/go/{cmath => math/cmplx}/isinf.go (97%) rename libgo/go/{cmath => math/cmplx}/isnan.go (97%) rename libgo/go/{cmath => math/cmplx}/log.go (99%) rename libgo/go/{cmath => math/cmplx}/phase.go (96%) rename libgo/go/{cmath => math/cmplx}/polar.go (96%) rename libgo/go/{cmath => math/cmplx}/pow.go (99%) rename libgo/go/{cmath => math/cmplx}/rect.go (95%) rename libgo/go/{cmath => math/cmplx}/sin.go (99%) rename libgo/go/{cmath => math/cmplx}/sqrt.go (99%) rename libgo/go/{cmath => math/cmplx}/tan.go (99%) rename libgo/go/{ => math}/rand/exp.go (100%) rename libgo/go/{ => math}/rand/normal.go (100%) rename libgo/go/{ => math}/rand/rand.go (100%) rename libgo/go/{ => math}/rand/rand_test.go (100%) rename libgo/go/{ => math}/rand/rng.go (100%) rename libgo/go/{ => math}/rand/zipf.go (100%) rename libgo/go/{ => net}/http/cgi/child.go (99%) rename libgo/go/{ => net}/http/cgi/child_test.go (100%) rename libgo/go/{ => net}/http/cgi/host.go (99%) rename libgo/go/{ => net}/http/cgi/host_test.go (99%) rename libgo/go/{ => net}/http/cgi/matryoshka_test.go (99%) rename libgo/go/{ => net}/http/cgi/testdata/test.cgi (100%) mode change 100755 => 100644 create mode 100644 libgo/go/net/http/chunked.go rename libgo/go/{ => net}/http/client.go (99%) rename libgo/go/{ => net}/http/client_test.go (99%) rename libgo/go/{ => net}/http/cookie.go (100%) rename libgo/go/{ => net}/http/cookie_test.go (99%) rename libgo/go/{ => net}/http/doc.go (100%) rename libgo/go/{ => net}/http/export_test.go (100%) rename libgo/go/{ => net}/http/fcgi/child.go (99%) rename libgo/go/{ => net}/http/fcgi/fcgi.go (100%) rename libgo/go/{ => net}/http/fcgi/fcgi_test.go (100%) rename libgo/go/{ => net}/http/filetransport.go (100%) rename libgo/go/{ => net}/http/filetransport_test.go (99%) rename libgo/go/{ => net}/http/fs.go (99%) rename libgo/go/{ => net}/http/fs_test.go (99%) rename libgo/go/{ => net}/http/header.go (96%) rename libgo/go/{ => net}/http/header_test.go (100%) rename libgo/go/{ => net}/http/httptest/recorder.go (99%) rename libgo/go/{ => net}/http/httptest/server.go (99%) rename libgo/go/{http => net/http/httputil}/chunked.go (78%) create mode 100644 libgo/go/net/http/httputil/chunked_test.go create mode 100644 libgo/go/net/http/httputil/dump.go create mode 100644 libgo/go/net/http/httputil/dump_test.go rename libgo/go/{http => net/http/httputil}/persist.go (90%) rename libgo/go/{http => net/http/httputil}/reverseproxy.go (87%) rename libgo/go/{http => net/http/httputil}/reverseproxy_test.go (84%) rename libgo/go/{ => net}/http/lex.go (100%) rename libgo/go/{ => net}/http/lex_test.go (100%) rename libgo/go/{ => net}/http/pprof/pprof.go (99%) rename libgo/go/{ => net}/http/proxy_test.go (100%) rename libgo/go/{ => net}/http/range_test.go (100%) rename libgo/go/{ => net}/http/readrequest_test.go (78%) rename libgo/go/{ => net}/http/request.go (92%) rename libgo/go/{ => net}/http/request_test.go (93%) rename libgo/go/{ => net}/http/requestwrite_test.go (93%) rename libgo/go/{ => net}/http/response.go (99%) rename libgo/go/{ => net}/http/response_test.go (99%) rename libgo/go/{ => net}/http/responsewrite_test.go (100%) rename libgo/go/{ => net}/http/serve_test.go (99%) rename libgo/go/{ => net}/http/server.go (99%) rename libgo/go/{ => net}/http/sniff.go (97%) rename libgo/go/{ => net}/http/sniff_test.go (95%) rename libgo/go/{ => net}/http/status.go (100%) rename libgo/go/{ => net}/http/testdata/file (100%) rename libgo/go/{ => net}/http/testdata/index.html (100%) rename libgo/go/{ => net}/http/testdata/style.css (100%) rename libgo/go/{ => net}/http/transfer.go (89%) rename libgo/go/{ => net}/http/transport.go (95%) rename libgo/go/{ => net}/http/transport_test.go (99%) rename libgo/go/{ => net}/http/transport_windows.go (100%) create mode 100644 libgo/go/net/http/triv.go rename libgo/go/{ => net}/mail/message.go (100%) rename libgo/go/{ => net}/mail/message_test.go (100%) rename libgo/go/{ => net}/rpc/client.go (99%) rename libgo/go/{ => net}/rpc/debug.go (98%) rename libgo/go/{ => net}/rpc/jsonrpc/all_test.go (99%) rename libgo/go/{ => net}/rpc/jsonrpc/client.go (99%) rename libgo/go/{ => net}/rpc/jsonrpc/server.go (99%) rename libgo/go/{ => net}/rpc/server.go (99%) rename libgo/go/{ => net}/rpc/server_test.go (99%) rename libgo/go/{ => net}/smtp/auth.go (100%) rename libgo/go/{ => net}/smtp/smtp.go (100%) rename libgo/go/{ => net}/smtp/smtp_test.go (100%) rename libgo/go/{ => net}/url/url.go (100%) rename libgo/go/{ => net}/url/url_test.go (100%) rename libgo/go/{ => os}/exec/exec.go (100%) rename libgo/go/{ => os}/exec/exec_test.go (100%) rename libgo/go/{ => os}/exec/lp_plan9.go (100%) rename libgo/go/{ => os}/exec/lp_test.go (100%) rename libgo/go/{ => os}/exec/lp_unix.go (100%) rename libgo/go/{ => os}/exec/lp_windows.go (100%) create mode 100644 libgo/go/regexp/testdata/re2-exhaustive.txt.bz2 rename libgo/go/{ => text}/scanner/scanner.go (99%) rename libgo/go/{ => text}/scanner/scanner_test.go (99%) rename libgo/go/{ => text}/tabwriter/tabwriter.go (99%) rename libgo/go/{ => text}/tabwriter/tabwriter_test.go (100%) rename libgo/go/{ => text}/template/doc.go (100%) rename libgo/go/{ => text}/template/exec.go (98%) rename libgo/go/{ => text}/template/exec_test.go (97%) rename libgo/go/{ => text}/template/funcs.go (99%) rename libgo/go/{ => text}/template/helper.go (100%) rename libgo/go/{ => text}/template/parse.go (88%) rename libgo/go/{ => text}/template/parse/lex.go (99%) rename libgo/go/{ => text}/template/parse/lex_test.go (100%) rename libgo/go/{ => text}/template/parse/node.go (100%) rename libgo/go/{ => text}/template/parse/parse.go (100%) rename libgo/go/{ => text}/template/parse/parse_test.go (100%) rename libgo/go/{ => text}/template/parse/set.go (100%) rename libgo/go/{ => text}/template/set.go (94%) rename libgo/go/{ => text}/template/set_test.go (100%) rename libgo/go/{ => text}/template/testdata/file1.tmpl (100%) rename libgo/go/{ => text}/template/testdata/file2.tmpl (100%) rename libgo/go/{ => text}/template/testdata/tmpl1.tmpl (100%) rename libgo/go/{ => text}/template/testdata/tmpl2.tmpl (100%) rename libgo/go/{ => unicode}/utf16/utf16.go (100%) rename libgo/go/{ => unicode}/utf16/utf16_test.go (99%) rename libgo/go/{ => unicode}/utf8/string.go (100%) rename libgo/go/{ => unicode}/utf8/string_test.go (98%) rename libgo/go/{ => unicode}/utf8/utf8.go (100%) rename libgo/go/{ => unicode}/utf8/utf8_test.go (99%) create mode 100644 libgo/runtime/time.goc diff --git a/gcc/testsuite/go.test/test/chan/select5.go b/gcc/testsuite/go.test/test/chan/select5.go index 60718216712..cc2cc71000e 100644 --- a/gcc/testsuite/go.test/test/chan/select5.go +++ b/gcc/testsuite/go.test/test/chan/select5.go @@ -18,7 +18,7 @@ import ( "fmt" "io" "os" - "template" + "text/template" ) func main() { diff --git a/gcc/testsuite/go.test/test/cmplxdivide.go b/gcc/testsuite/go.test/test/cmplxdivide.go index 6a67b175de1..461ee9796ed 100644 --- a/gcc/testsuite/go.test/test/cmplxdivide.go +++ b/gcc/testsuite/go.test/test/cmplxdivide.go @@ -9,14 +9,14 @@ package main import ( - "cmath" "fmt" "math" + "math/cmplx" ) -type Test struct{ - f, g complex128 - out complex128 +type Test struct { + f, g complex128 + out complex128 } var nan = math.NaN() @@ -25,9 +25,9 @@ var negzero = math.Copysign(0, -1) func calike(a, b complex128) bool { switch { - case cmath.IsInf(a) && cmath.IsInf(b): + case cmplx.IsInf(a) && cmplx.IsInf(b): return true - case cmath.IsNaN(a) && cmath.IsNaN(b): + case cmplx.IsNaN(a) && cmplx.IsNaN(b): return true } return a == b @@ -36,7 +36,7 @@ func calike(a, b complex128) bool { func main() { bad := false for _, t := range tests { - x := t.f/t.g + x := t.f / t.g if !calike(x, t.out) { if !bad { fmt.Printf("BUG\n") diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug358.go b/gcc/testsuite/go.test/test/fixedbugs/bug358.go index f43709b7e25..82fbf7f8150 100644 --- a/gcc/testsuite/go.test/test/fixedbugs/bug358.go +++ b/gcc/testsuite/go.test/test/fixedbugs/bug358.go @@ -10,8 +10,8 @@ package main import ( - "http" "io/ioutil" // GCCGO_ERROR "imported and not used" + "net/http" "os" ) diff --git a/gcc/testsuite/go.test/test/ken/divconst.go b/gcc/testsuite/go.test/test/ken/divconst.go index c3b9092cdc4..5a64d16b490 100644 --- a/gcc/testsuite/go.test/test/ken/divconst.go +++ b/gcc/testsuite/go.test/test/ken/divconst.go @@ -6,7 +6,7 @@ package main -import "rand" +import "math/rand" const Count = 1e5 diff --git a/gcc/testsuite/go.test/test/ken/modconst.go b/gcc/testsuite/go.test/test/ken/modconst.go index acb8831ef70..c2603a0a099 100644 --- a/gcc/testsuite/go.test/test/ken/modconst.go +++ b/gcc/testsuite/go.test/test/ken/modconst.go @@ -6,7 +6,7 @@ package main -import "rand" +import "math/rand" const Count = 1e5 diff --git a/gcc/testsuite/go.test/test/mallocrand.go b/gcc/testsuite/go.test/test/mallocrand.go index f014b441b2b..726e36799a8 100644 --- a/gcc/testsuite/go.test/test/mallocrand.go +++ b/gcc/testsuite/go.test/test/mallocrand.go @@ -10,7 +10,7 @@ package main import ( "flag" - "rand" + "math/rand" "runtime" "unsafe" ) diff --git a/gcc/testsuite/go.test/test/stringrange.go b/gcc/testsuite/go.test/test/stringrange.go index d5ada2628df..6a7063e239d 100644 --- a/gcc/testsuite/go.test/test/stringrange.go +++ b/gcc/testsuite/go.test/test/stringrange.go @@ -9,28 +9,29 @@ package main import ( "fmt" "os" - "utf8" + "unicode/utf8" ) func main() { s := "\000\123\x00\xca\xFE\u0123\ubabe\U0000babe\U0010FFFFx" - expect := []int{ 0, 0123, 0, 0xFFFD, 0xFFFD, 0x123, 0xbabe, 0xbabe, 0x10FFFF, 'x' } + expect := []rune{0, 0123, 0, 0xFFFD, 0xFFFD, 0x123, 0xbabe, 0xbabe, 0x10FFFF, 'x'} offset := 0 - var i, c int + var i int + var c rune ok := true cnum := 0 for i, c = range s { - rune, size := utf8.DecodeRuneInString(s[i:len(s)]) // check it another way + r, size := utf8.DecodeRuneInString(s[i:len(s)]) // check it another way if i != offset { fmt.Printf("unexpected offset %d not %d\n", i, offset) ok = false } - if rune != expect[cnum] { - fmt.Printf("unexpected rune %d from DecodeRuneInString: %x not %x\n", i, rune, expect[cnum]) + if r != expect[cnum] { + fmt.Printf("unexpected rune %d from DecodeRuneInString: %x not %x\n", i, r, expect[cnum]) ok = false } if c != expect[cnum] { - fmt.Printf("unexpected rune %d from range: %x not %x\n", i, rune, expect[cnum]) + fmt.Printf("unexpected rune %d from range: %x not %x\n", i, r, expect[cnum]) ok = false } offset += size diff --git a/gcc/testsuite/go.test/test/utf.go b/gcc/testsuite/go.test/test/utf.go index a93fc293416..9fba58156b3 100644 --- a/gcc/testsuite/go.test/test/utf.go +++ b/gcc/testsuite/go.test/test/utf.go @@ -6,10 +6,10 @@ package main -import "utf8" +import "unicode/utf8" func main() { - var chars [6] int + var chars [6]rune chars[0] = 'a' chars[1] = 'b' chars[2] = 'c' @@ -21,16 +21,22 @@ func main() { s += string(chars[i]) } var l = len(s) - for w, i, j := 0,0,0; i < l; i += w { - var r int + for w, i, j := 0, 0, 0; i < l; i += w { + var r rune r, w = utf8.DecodeRuneInString(s[i:len(s)]) - if w == 0 { panic("zero width in string") } - if r != chars[j] { panic("wrong value from string") } + if w == 0 { + panic("zero width in string") + } + if r != chars[j] { + panic("wrong value from string") + } j++ } // encoded as bytes: 'a' 'b' 'c' e6 97 a5 e6 9c ac e8 aa 9e const L = 12 - if L != l { panic("wrong length constructing array") } + if L != l { + panic("wrong length constructing array") + } a := make([]byte, L) a[0] = 'a' a[1] = 'b' @@ -44,11 +50,15 @@ func main() { a[9] = 0xe8 a[10] = 0xaa a[11] = 0x9e - for w, i, j := 0,0,0; i < L; i += w { - var r int + for w, i, j := 0, 0, 0; i < L; i += w { + var r rune r, w = utf8.DecodeRune(a[i:L]) - if w == 0 { panic("zero width in bytes") } - if r != chars[j] { panic("wrong value from bytes") } + if w == 0 { + panic("zero width in bytes") + } + if r != chars[j] { + panic("wrong value from bytes") + } j++ } } diff --git a/libgo/MERGE b/libgo/MERGE index f55d80b9670..5e896c008bf 100644 --- a/libgo/MERGE +++ b/libgo/MERGE @@ -1,4 +1,4 @@ -780c85032b17 +2f4482b89a6b The first line of this file holds the Mercurial revision number of the last merge done from the master library sources. diff --git a/libgo/Makefile.am b/libgo/Makefile.am index 9a4588e441e..cd264e32668 100644 --- a/libgo/Makefile.am +++ b/libgo/Makefile.am @@ -100,56 +100,36 @@ toolexeclib_LIBRARIES = libgobegin.a toolexeclibgodir = $(toolexeclibdir)/go/$(gcc_version)/$(target_alias) toolexeclibgo_DATA = \ - asn1.gox \ - big.gox \ bufio.gox \ bytes.gox \ - cmath.gox \ crypto.gox \ - csv.gox \ errors.gox \ - exec.gox \ expvar.gox \ flag.gox \ fmt.gox \ - gob.gox \ hash.gox \ html.gox \ - http.gox \ image.gox \ io.gox \ - json.gox \ log.gox \ math.gox \ - mail.gox \ mime.gox \ net.gox \ os.gox \ patch.gox \ path.gox \ - rand.gox \ reflect.gox \ regexp.gox \ - rpc.gox \ runtime.gox \ - scanner.gox \ - smtp.gox \ sort.gox \ strconv.gox \ strings.gox \ sync.gox \ syscall.gox \ - syslog.gox \ - tabwriter.gox \ - template.gox \ testing.gox \ time.gox \ unicode.gox \ - url.gox \ - utf16.gox \ - utf8.gox \ - websocket.gox \ - xml.gox + websocket.gox toolexeclibgoarchivedir = $(toolexeclibgodir)/archive @@ -230,12 +210,17 @@ toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding toolexeclibgoencoding_DATA = \ encoding/ascii85.gox \ + encoding/asn1.gox \ encoding/base32.gox \ encoding/base64.gox \ encoding/binary.gox \ + encoding/csv.gox \ encoding/git85.gox \ + encoding/gob.gox \ encoding/hex.gox \ - encoding/pem.gox + encoding/json.gox \ + encoding/pem.gox \ + encoding/xml.gox if LIBGO_IS_LINUX # exp_inotify_gox = exp/inotify.gox @@ -267,11 +252,6 @@ toolexeclibgoexpsqldir = $(toolexeclibgoexpdir)/sql toolexeclibgoexpsql_DATA = \ exp/sql/driver.gox -toolexeclibgoexptemplatedir = $(toolexeclibgoexpdir)/template - -toolexeclibgoexptemplate_DATA = \ - exp/template/html.gox - toolexeclibgogodir = $(toolexeclibgodir)/go toolexeclibgogo_DATA = \ @@ -291,13 +271,10 @@ toolexeclibgohash_DATA = \ hash/crc64.gox \ hash/fnv.gox -toolexeclibgohttpdir = $(toolexeclibgodir)/http +toolexeclibgohtmldir = $(toolexeclibgodir)/html -toolexeclibgohttp_DATA = \ - http/cgi.gox \ - http/fcgi.gox \ - http/httptest.gox \ - http/pprof.gox +toolexeclibgohtml_DATA = \ + html/template.gox toolexeclibgoimagedir = $(toolexeclibgodir)/image @@ -321,6 +298,18 @@ toolexeclibgoiodir = $(toolexeclibgodir)/io toolexeclibgoio_DATA = \ io/ioutil.gox +toolexeclibgologdir = $(toolexeclibgodir)/log + +toolexeclibgolog_DATA = \ + log/syslog.gox + +toolexeclibgomathdir = $(toolexeclibgodir)/math + +toolexeclibgomath_DATA = \ + math/big.gox \ + math/cmplx.gox \ + math/rand.gox + toolexeclibgomimedir = $(toolexeclibgodir)/mime toolexeclibgomime_DATA = \ @@ -330,7 +319,26 @@ toolexeclibgonetdir = $(toolexeclibgodir)/net toolexeclibgonet_DATA = \ net/dict.gox \ - net/textproto.gox + net/http.gox \ + net/mail.gox \ + net/rpc.gox \ + net/smtp.gox \ + net/textproto.gox \ + net/url.gox + +toolexeclibgonethttpdir = $(toolexeclibgonetdir)/http + +toolexeclibgonethttp_DATA = \ + net/http/cgi.gox \ + net/http/fcgi.gox \ + net/http/httptest.gox \ + net/http/httputil.gox \ + net/http/pprof.gox + +toolexeclibgonetrpcdir = $(toolexeclibgonetdir)/rpc + +toolexeclibgonetrpc_DATA = \ + net/rpc/jsonrpc.gox toolexeclibgoolddir = $(toolexeclibgodir)/old @@ -342,6 +350,7 @@ toolexeclibgoold_DATA = \ toolexeclibgoosdir = $(toolexeclibgodir)/os toolexeclibgoos_DATA = \ + os/exec.gox \ os/user.gox \ os/signal.gox @@ -355,22 +364,12 @@ toolexeclibgoregexpdir = $(toolexeclibgodir)/regexp toolexeclibgoregexp_DATA = \ regexp/syntax.gox -toolexeclibgorpcdir = $(toolexeclibgodir)/rpc - -toolexeclibgorpc_DATA = \ - rpc/jsonrpc.gox - toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime toolexeclibgoruntime_DATA = \ runtime/debug.gox \ runtime/pprof.gox -toolexeclibgotemplatedir = $(toolexeclibgodir)/template - -toolexeclibgotemplate_DATA = \ - template/parse.gox - toolexeclibgosyncdir = $(toolexeclibgodir)/sync toolexeclibgosync_DATA = \ @@ -383,6 +382,24 @@ toolexeclibgotesting_DATA = \ testing/quick.gox \ testing/script.gox +toolexeclibgotextdir = $(toolexeclibgodir)/text + +toolexeclibgotext_DATA = \ + text/scanner.gox \ + text/tabwriter.gox \ + text/template.gox + +toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template + +toolexeclibgotexttemplate_DATA = \ + text/template/parse.gox + +toolexeclibgounicodedir = $(toolexeclibgodir)/unicode + +toolexeclibgounicode_DATA = \ + unicode/utf16.gox \ + unicode/utf8.gox + if HAVE_SYS_MMAN_H runtime_mem_file = runtime/mem.c else @@ -484,7 +501,8 @@ runtime_files = \ runtime1.c \ sema.c \ sigqueue.c \ - string.c + string.c \ + time.c goc2c.$(OBJEXT): runtime/goc2c.c $(CC_FOR_BUILD) -c $(CFLAGS_FOR_BUILD) $< @@ -516,21 +534,14 @@ sigqueue.c: $(srcdir)/runtime/sigqueue.goc goc2c ./goc2c --gcc --go-prefix libgo_runtime $< > $@.tmp mv -f $@.tmp $@ +time.c: $(srcdir)/runtime/time.goc goc2c + ./goc2c --gcc --go-prefix libgo_time $< > $@.tmp + mv -f $@.tmp $@ + %.c: $(srcdir)/runtime/%.goc goc2c ./goc2c --gcc $< > $@.tmp mv -f $@.tmp $@ -go_asn1_files = \ - go/asn1/asn1.go \ - go/asn1/common.go \ - go/asn1/marshal.go - -go_big_files = \ - go/big/arith.go \ - go/big/int.go \ - go/big/nat.go \ - go/big/rat.go - go_bufio_files = \ go/bufio/bufio.go @@ -541,36 +552,12 @@ go_bytes_files = \ go_bytes_c_files = \ go/bytes/indexbyte.c -go_cmath_files = \ - go/cmath/abs.go \ - go/cmath/asin.go \ - go/cmath/conj.go \ - go/cmath/exp.go \ - go/cmath/isinf.go \ - go/cmath/isnan.go \ - go/cmath/log.go \ - go/cmath/phase.go \ - go/cmath/polar.go \ - go/cmath/pow.go \ - go/cmath/rect.go \ - go/cmath/sin.go \ - go/cmath/sqrt.go \ - go/cmath/tan.go - go_crypto_files = \ go/crypto/crypto.go -go_csv_files = \ - go/csv/reader.go \ - go/csv/writer.go - go_errors_files = \ go/errors/errors.go -go_exec_files = \ - go/exec/exec.go \ - go/exec/lp_unix.go - go_expvar_files = \ go/expvar/expvar.go @@ -583,15 +570,6 @@ go_fmt_files = \ go/fmt/print.go \ go/fmt/scan.go -go_gob_files = \ - go/gob/decode.go \ - go/gob/decoder.go \ - go/gob/doc.go \ - go/gob/encode.go \ - go/gob/encoder.go \ - go/gob/error.go \ - go/gob/type.go - go_hash_files = \ go/hash/hash.go @@ -605,25 +583,6 @@ go_html_files = \ go/html/render.go \ go/html/token.go -go_http_files = \ - go/http/chunked.go \ - go/http/client.go \ - go/http/cookie.go \ - go/http/dump.go \ - go/http/filetransport.go \ - go/http/fs.go \ - go/http/header.go \ - go/http/lex.go \ - go/http/persist.go \ - go/http/request.go \ - go/http/response.go \ - go/http/reverseproxy.go \ - go/http/server.go \ - go/http/sniff.go \ - go/http/status.go \ - go/http/transfer.go \ - go/http/transport.go - go_image_files = \ go/image/format.go \ go/image/geom.go \ @@ -635,14 +594,6 @@ go_io_files = \ go/io/io.go \ go/io/pipe.go -go_json_files = \ - go/json/decode.go \ - go/json/encode.go \ - go/json/indent.go \ - go/json/scanner.go \ - go/json/stream.go \ - go/json/tags.go - go_log_files = \ go/log/log.go @@ -694,9 +645,6 @@ go_math_files = \ go/math/tanh.go \ go/math/unsafe.go -go_mail_files = \ - go/mail/message.go - go_mime_files = \ go/mime/grammar.go \ go/mime/mediatype.go \ @@ -852,13 +800,6 @@ go_path_files = \ go/path/match.go \ go/path/path.go -go_rand_files = \ - go/rand/exp.go \ - go/rand/normal.go \ - go/rand/rand.go \ - go/rand/rng.go \ - go/rand/zipf.go - go_reflect_files = \ go/reflect/deepequal.go \ go/reflect/type.go \ @@ -868,10 +809,10 @@ go_regexp_files = \ go/regexp/exec.go \ go/regexp/regexp.go -go_rpc_files = \ - go/rpc/client.go \ - go/rpc/debug.go \ - go/rpc/server.go +go_net_rpc_files = \ + go/net/rpc/client.go \ + go/net/rpc/debug.go \ + go/net/rpc/server.go go_runtime_files = \ go/runtime/debug.go \ @@ -894,13 +835,6 @@ s-version: Makefile $(SHELL) $(srcdir)/../move-if-change version.go.tmp version.go $(STAMP) $@ -go_scanner_files = \ - go/scanner/scanner.go - -go_smtp_files = \ - go/smtp/auth.go \ - go/smtp/smtp.go - go_sort_files = \ go/sort/search.go \ go/sort/sort.go @@ -927,31 +861,20 @@ go_sync_files = \ go/sync/waitgroup.go if LIBGO_IS_SOLARIS -go_syslog_file = go/syslog/syslog_libc.go +go_syslog_file = go/log/syslog/syslog_libc.go else if LIBGO_IS_IRIX -go_syslog_file = go/syslog/syslog_libc.go +go_syslog_file = go/log/syslog/syslog_libc.go else -go_syslog_file = go/syslog/syslog_unix.go +go_syslog_file = go/log/syslog/syslog_unix.go endif endif -go_syslog_files = \ - go/syslog/syslog.go \ +go_log_syslog_files = \ + go/log/syslog/syslog.go \ $(go_syslog_file) go_syslog_c_files = \ - go/syslog/syslog_c.c - -go_tabwriter_files = \ - go/tabwriter/tabwriter.go - -go_template_files = \ - go/template/doc.go \ - go/template/exec.go \ - go/template/funcs.go \ - go/template/helper.go \ - go/template/parse.go \ - go/template/set.go + go/log/syslog/syslog_c.c go_testing_files = \ go/testing/benchmark.go \ @@ -975,16 +898,6 @@ go_unicode_files = \ go/unicode/letter.go \ go/unicode/tables.go -go_url_files = \ - go/url/url.go - -go_utf16_files = \ - go/utf16/utf16.go - -go_utf8_files = \ - go/utf8/string.go \ - go/utf8/utf8.go - go_websocket_files = \ go/websocket/client.go \ go/websocket/hixie.go \ @@ -992,10 +905,6 @@ go_websocket_files = \ go/websocket/server.go \ go/websocket/websocket.go -go_xml_files = \ - go/xml/marshal.go \ - go/xml/read.go \ - go/xml/xml.go go_archive_tar_files = \ go/archive/tar/common.go \ @@ -1183,6 +1092,10 @@ go_debug_pe_files = \ go_encoding_ascii85_files = \ go/encoding/ascii85/ascii85.go +go_encoding_asn1_files = \ + go/encoding/asn1/asn1.go \ + go/encoding/asn1/common.go \ + go/encoding/asn1/marshal.go go_encoding_base32_files = \ go/encoding/base32/base32.go go_encoding_base64_files = \ @@ -1190,12 +1103,34 @@ go_encoding_base64_files = \ go_encoding_binary_files = \ go/encoding/binary/binary.go \ go/encoding/binary/varint.go +go_encoding_csv_files = \ + go/encoding/csv/reader.go \ + go/encoding/csv/writer.go go_encoding_git85_files = \ go/encoding/git85/git.go +go_encoding_gob_files = \ + go/encoding/gob/decode.go \ + go/encoding/gob/decoder.go \ + go/encoding/gob/doc.go \ + go/encoding/gob/encode.go \ + go/encoding/gob/encoder.go \ + go/encoding/gob/error.go \ + go/encoding/gob/type.go go_encoding_hex_files = \ go/encoding/hex/hex.go +go_encoding_json_files = \ + go/encoding/json/decode.go \ + go/encoding/json/encode.go \ + go/encoding/json/indent.go \ + go/encoding/json/scanner.go \ + go/encoding/json/stream.go \ + go/encoding/json/tags.go go_encoding_pem_files = \ go/encoding/pem/pem.go +go_encoding_xml_files = \ + go/encoding/xml/marshal.go \ + go/encoding/xml/read.go \ + go/encoding/xml/xml.go go_exp_ebnf_files = \ go/exp/ebnf/ebnf.go \ @@ -1222,6 +1157,7 @@ go_exp_sql_files = \ go_exp_ssh_files = \ go/exp/ssh/channel.go \ go/exp/ssh/client.go \ + go/exp/ssh/client_auth.go \ go/exp/ssh/common.go \ go/exp/ssh/doc.go \ go/exp/ssh/messages.go \ @@ -1248,23 +1184,10 @@ go_exp_sql_driver_files = \ go/exp/sql/driver/driver.go \ go/exp/sql/driver/types.go -go_exp_template_html_files = \ - go/exp/template/html/attr.go \ - go/exp/template/html/clone.go \ - go/exp/template/html/content.go \ - go/exp/template/html/context.go \ - go/exp/template/html/css.go \ - go/exp/template/html/doc.go \ - go/exp/template/html/error.go \ - go/exp/template/html/escape.go \ - go/exp/template/html/html.go \ - go/exp/template/html/js.go \ - go/exp/template/html/transition.go \ - go/exp/template/html/url.go - go_go_ast_files = \ go/go/ast/ast.go \ go/go/ast/filter.go \ + go/go/ast/import.go \ go/go/ast/print.go \ go/go/ast/resolve.go \ go/go/ast/scope.go \ @@ -1302,17 +1225,20 @@ go_hash_crc64_files = \ go_hash_fnv_files = \ go/hash/fnv/fnv.go -go_http_cgi_files = \ - go/http/cgi/child.go \ - go/http/cgi/host.go -go_http_fcgi_files = \ - go/http/fcgi/child.go \ - go/http/fcgi/fcgi.go -go_http_httptest_files = \ - go/http/httptest/recorder.go \ - go/http/httptest/server.go -go_http_pprof_files = \ - go/http/pprof/pprof.go +go_html_template_files = \ + go/html/template/attr.go \ + go/html/template/clone.go \ + go/html/template/content.go \ + go/html/template/context.go \ + go/html/template/css.go \ + go/html/template/doc.go \ + go/html/template/error.go \ + go/html/template/escape.go \ + go/html/template/html.go \ + go/html/template/js.go \ + go/html/template/template.go \ + go/html/template/transition.go \ + go/html/template/url.go go_image_bmp_files = \ go/image/bmp/reader.go @@ -1354,6 +1280,33 @@ go_io_ioutil_files = \ go/io/ioutil/ioutil.go \ go/io/ioutil/tempfile.go +go_math_big_files = \ + go/math/big/arith.go \ + go/math/big/int.go \ + go/math/big/nat.go \ + go/math/big/rat.go +go_math_cmplx_files = \ + go/math/cmplx/abs.go \ + go/math/cmplx/asin.go \ + go/math/cmplx/conj.go \ + go/math/cmplx/exp.go \ + go/math/cmplx/isinf.go \ + go/math/cmplx/isnan.go \ + go/math/cmplx/log.go \ + go/math/cmplx/phase.go \ + go/math/cmplx/polar.go \ + go/math/cmplx/pow.go \ + go/math/cmplx/rect.go \ + go/math/cmplx/sin.go \ + go/math/cmplx/sqrt.go \ + go/math/cmplx/tan.go +go_math_rand_files = \ + go/math/rand/exp.go \ + go/math/rand/normal.go \ + go/math/rand/rand.go \ + go/math/rand/rng.go \ + go/math/rand/zipf.go + go_mime_multipart_files = \ go/mime/multipart/formdata.go \ go/mime/multipart/multipart.go \ @@ -1361,13 +1314,52 @@ go_mime_multipart_files = \ go_net_dict_files = \ go/net/dict/dict.go - +go_net_http_files = \ + go/net/http/chunked.go \ + go/net/http/client.go \ + go/net/http/cookie.go \ + go/net/http/filetransport.go \ + go/net/http/fs.go \ + go/net/http/header.go \ + go/net/http/lex.go \ + go/net/http/request.go \ + go/net/http/response.go \ + go/net/http/server.go \ + go/net/http/sniff.go \ + go/net/http/status.go \ + go/net/http/transfer.go \ + go/net/http/transport.go +go_net_mail_files = \ + go/net/mail/message.go +go_net_smtp_files = \ + go/net/smtp/auth.go \ + go/net/smtp/smtp.go go_net_textproto_files = \ go/net/textproto/header.go \ go/net/textproto/pipeline.go \ go/net/textproto/reader.go \ go/net/textproto/textproto.go \ go/net/textproto/writer.go +go_net_url_files = \ + go/net/url/url.go + +go_net_http_cgi_files = \ + go/net/http/cgi/child.go \ + go/net/http/cgi/host.go +go_net_http_fcgi_files = \ + go/net/http/fcgi/child.go \ + go/net/http/fcgi/fcgi.go +go_net_http_httptest_files = \ + go/net/http/httptest/recorder.go \ + go/net/http/httptest/server.go +go_net_http_pprof_files = \ + go/net/http/pprof/pprof.go +go_net_http_httputil_files = \ + go/net/http/httputil/chunked.go \ + go/net/http/httputil/dump.go \ + go/net/http/httputil/persist.go \ + go/net/http/httputil/reverseproxy.go + go_old_netchan_files = \ go/old/netchan/common.go \ @@ -1381,6 +1373,10 @@ go_old_template_files = \ go/old/template/format.go \ go/old/template/parse.go +go_os_exec_files = \ + go/os/exec/exec.go \ + go/os/exec/lp_unix.go + go_os_user_files = \ go/os/user/user.go \ go/os/user/lookup_unix.go @@ -1401,20 +1397,29 @@ go_regexp_syntax_files = \ go/regexp/syntax/regexp.go \ go/regexp/syntax/simplify.go -go_rpc_jsonrpc_files = \ - go/rpc/jsonrpc/client.go \ - go/rpc/jsonrpc/server.go +go_net_rpc_jsonrpc_files = \ + go/net/rpc/jsonrpc/client.go \ + go/net/rpc/jsonrpc/server.go go_runtime_debug_files = \ go/runtime/debug/stack.go go_runtime_pprof_files = \ go/runtime/pprof/pprof.go -go_template_parse_files = \ - go/template/parse/lex.go \ - go/template/parse/node.go \ - go/template/parse/parse.go \ - go/template/parse/set.go +go_text_tabwriter_files = \ + go/text/tabwriter/tabwriter.go +go_text_template_files = \ + go/text/template/doc.go \ + go/text/template/exec.go \ + go/text/template/funcs.go \ + go/text/template/helper.go \ + go/text/template/parse.go \ + go/text/template/set.go +go_text_template_parse_files = \ + go/text/template/parse/lex.go \ + go/text/template/parse/node.go \ + go/text/template/parse/parse.go \ + go/text/template/parse/set.go go_sync_atomic_files = \ go/sync/atomic/doc.go @@ -1430,6 +1435,15 @@ go_testing_quick_files = \ go_testing_script_files = \ go/testing/script/script.go +go_text_scanner_files = \ + go/text/scanner/scanner.go + +go_unicode_utf16_files = \ + go/unicode/utf16/utf16.go +go_unicode_utf8_files = \ + go/unicode/utf8/string.go \ + go/unicode/utf8/utf8.go + # Define Syscall and Syscall6. if LIBGO_IS_RTEMS syscall_syscall_file = go/syscall/syscall_stubs.go @@ -1619,56 +1633,35 @@ os_lib_inotify_lo = endif libgo_go_objs = \ - asn1/asn1.lo \ - big/big.lo \ bufio/bufio.lo \ bytes/bytes.lo \ bytes/index.lo \ - cmath/cmath.lo \ crypto/crypto.lo \ - csv/csv.lo \ errors/errors.lo \ - exec/exec.lo \ expvar/expvar.lo \ flag/flag.lo \ fmt/fmt.lo \ - gob/gob.lo \ hash/hash.lo \ html/html.lo \ - http/http.lo \ image/image.lo \ io/io.lo \ - json/json.lo \ log/log.lo \ math/math.lo \ - mail/mail.lo \ - mime/mime.lo \ net/net.lo \ + os/exec.lo \ os/os.lo \ patch/patch.lo \ path/path.lo \ - rand/rand.lo \ reflect/reflect.lo \ regexp/regexp.lo \ - rpc/rpc.lo \ runtime/runtime.lo \ - scanner/scanner.lo \ - smtp/smtp.lo \ sort/sort.lo \ strconv/strconv.lo \ strings/strings.lo \ sync/sync.lo \ - syslog/syslog.lo \ - syslog/syslog_c.lo \ - tabwriter/tabwriter.lo \ - template/template.lo \ time/time.lo \ unicode/unicode.lo \ - url/url.lo \ - utf16/utf16.lo \ - utf8/utf8.lo \ websocket/websocket.lo \ - xml/xml.lo \ archive/tar.lo \ archive/zip.lo \ compress/bzip2.lo \ @@ -1717,12 +1710,17 @@ libgo_go_objs = \ debug/macho.lo \ debug/pe.lo \ encoding/ascii85.lo \ + encoding/asn1.lo \ encoding/base32.lo \ encoding/base64.lo \ encoding/binary.lo \ + encoding/csv.lo \ encoding/git85.lo \ + encoding/gob.lo \ encoding/hex.lo \ + encoding/json.lo \ encoding/pem.lo \ + encoding/xml.lo \ exp/ebnf.lo \ exp/gui.lo \ exp/norm.lo \ @@ -1733,7 +1731,7 @@ libgo_go_objs = \ exp/types.lo \ exp/gui/x11.lo \ exp/sql/driver.lo \ - exp/template/html.lo \ + html/template.lo \ go/ast.lo \ go/build.lo \ go/doc.lo \ @@ -1745,10 +1743,11 @@ libgo_go_objs = \ hash/crc32.lo \ hash/crc64.lo \ hash/fnv.lo \ - http/cgi.lo \ - http/fcgi.lo \ - http/httptest.lo \ - http/pprof.lo \ + net/http/cgi.lo \ + net/http/fcgi.lo \ + net/http/httptest.lo \ + net/http/httputil.lo \ + net/http/pprof.lo \ image/bmp.lo \ image/color.lo \ image/draw.lo \ @@ -1759,9 +1758,20 @@ libgo_go_objs = \ image/ycbcr.lo \ index/suffixarray.lo \ io/ioutil.lo \ + log/syslog.lo \ + log/syslog/syslog_c.lo \ + math/big.lo \ + math/cmplx.lo \ + math/rand.lo \ + mime/mime.lo \ mime/multipart.lo \ net/dict.lo \ + net/http.lo \ + net/mail.lo \ + net/rpc.lo \ + net/smtp.lo \ net/textproto.lo \ + net/url.lo \ old/netchan.lo \ old/regexp.lo \ old/template.lo \ @@ -1770,7 +1780,7 @@ libgo_go_objs = \ os/signal.lo \ path/filepath.lo \ regexp/syntax.lo \ - rpc/jsonrpc.lo \ + net/rpc/jsonrpc.lo \ runtime/debug.lo \ runtime/pprof.lo \ sync/atomic.lo \ @@ -1778,11 +1788,16 @@ libgo_go_objs = \ syscall/syscall.lo \ syscall/errno.lo \ syscall/wait.lo \ - template/parse.lo \ + text/scanner.lo \ + text/tabwriter.lo \ + text/template.lo \ + text/template/parse.lo \ testing/testing.lo \ testing/iotest.lo \ testing/quick.lo \ - testing/script.lo + testing/script.lo \ + unicode/utf16.lo \ + unicode/utf8.lo libgo_la_SOURCES = $(runtime_files) @@ -1871,36 +1886,23 @@ CHECK_DEPS = libgo.la libgobegin.a \ $(toolexeclibgoexp_DATA) \ $(toolexeclibgogo_DATA) \ $(toolexeclibgohash_DATA) \ - $(toolexeclibgohttp_DATA) \ $(toolexeclibgoimage_DATA) \ $(toolexeclibgoindex_DATA) \ $(toolexeclibgoio_DATA) \ + $(toolexeclibgolog_DATA) \ + $(toolexeclibgomath_DATA) \ $(toolexeclibgomime_DATA) \ $(toolexeclibgonet_DATA) \ + $(toolexeclibgonethttp_DATA) \ $(toolexeclibgoos_DATA) \ $(toolexeclibgopath_DATA) \ $(toolexeclibgorpc_DATA) \ $(toolexeclibgoruntime_DATA) \ $(toolexeclibgosync_DATA) \ - $(toolexeclibgotesting_DATA) - -@go_include@ asn1/asn1.lo.dep -asn1/asn1.lo.dep: $(go_asn1_files) - $(BUILDDEPS) -asn1/asn1.lo: $(go_asn1_files) - $(BUILDPACKAGE) -asn1/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: asn1/check - -@go_include@ big/big.lo.dep -big/big.lo.dep: $(go_big_files) - $(BUILDDEPS) -big/big.lo: $(go_big_files) - $(BUILDPACKAGE) -big/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: big/check + $(toolexeclibgotesting_DATA) \ + $(toolexeclibgotext_DATA) \ + $(toolexeclibgotexttemplate_DATA) \ + $(toolexeclibgounicode_DATA) @go_include@ bufio/bufio.lo.dep bufio/bufio.lo.dep: $(go_bufio_files) @@ -1922,15 +1924,6 @@ bytes/check: $(CHECK_DEPS) @$(CHECK) .PHONY: bytes/check -@go_include@ cmath/cmath.lo.dep -cmath/cmath.lo.dep: $(go_cmath_files) - $(BUILDDEPS) -cmath/cmath.lo: $(go_cmath_files) - $(BUILDPACKAGE) -cmath/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: cmath/check - @go_include@ crypto/crypto.lo.dep crypto/crypto.lo.dep: $(go_crypto_files) $(BUILDDEPS) @@ -1940,15 +1933,6 @@ crypto/check: $(CHECK_DEPS) @$(CHECK) .PHONY: crypto/check -@go_include@ csv/csv.lo.dep -csv/csv.lo.dep: $(go_csv_files) - $(BUILDDEPS) -csv/csv.lo: $(go_csv_files) - $(BUILDPACKAGE) -csv/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: csv/check - @go_include@ errors/errors.lo.dep errors/errors.lo.dep: $(go_errors_files) $(BUILDDEPS) @@ -1958,15 +1942,6 @@ errors/check: $(CHECK_DEPS) @$(CHECK) .PHONY: errors/check -@go_include@ exec/exec.lo.dep -exec/exec.lo.dep: $(go_exec_files) - $(BUILDDEPS) -exec/exec.lo: $(go_exec_files) - $(BUILDPACKAGE) -exec/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: exec/check - @go_include@ expvar/expvar.lo.dep expvar/expvar.lo.dep: $(go_expvar_files) $(BUILDDEPS) @@ -1994,15 +1969,6 @@ fmt/check: $(CHECK_DEPS) @$(CHECK) .PHONY: fmt/check -@go_include@ gob/gob.lo.dep -gob/gob.lo.dep: $(go_gob_files) - $(BUILDDEPS) -gob/gob.lo: $(go_gob_files) - $(BUILDPACKAGE) -gob/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: gob/check - @go_include@ hash/hash.lo.dep hash/hash.lo.dep: $(go_hash_files) $(BUILDDEPS) @@ -2021,15 +1987,6 @@ html/check: $(CHECK_DEPS) @$(CHECK) .PHONY: html/check -@go_include@ http/http.lo.dep -http/http.lo.dep: $(go_http_files) - $(BUILDDEPS) -http/http.lo: $(go_http_files) - $(BUILDPACKAGE) -http/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: http/check - @go_include@ image/image.lo.dep image/image.lo.dep: $(go_image_files) $(BUILDDEPS) @@ -2048,15 +2005,6 @@ io/check: $(CHECK_DEPS) @$(CHECK) .PHONY: io/check -@go_include@ json/json.lo.dep -json/json.lo.dep: $(go_json_files) - $(BUILDDEPS) -json/json.lo: $(go_json_files) - $(BUILDPACKAGE) -json/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: json/check - @go_include@ log/log.lo.dep log/log.lo.dep: $(go_log_files) $(BUILDDEPS) @@ -2075,15 +2023,6 @@ math/check: $(CHECK_DEPS) @$(CHECK) .PHONY: math/check -@go_include@ mail/mail.lo.dep -mail/mail.lo.dep: $(go_mail_files) - $(BUILDDEPS) -mail/mail.lo: $(go_mail_files) - $(BUILDPACKAGE) -mail/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: mail/check - @go_include@ mime/mime.lo.dep mime/mime.lo.dep: $(go_mime_files) $(BUILDDEPS) @@ -2133,15 +2072,6 @@ path/check: $(CHECK_DEPS) @$(CHECK) .PHONY: path/check -@go_include@ rand/rand.lo.dep -rand/rand.lo.dep: $(go_rand_files) - $(BUILDDEPS) -rand/rand.lo: $(go_rand_files) - $(BUILDPACKAGE) -rand/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: rand/check - @go_include@ reflect/reflect.lo.dep reflect/reflect.lo.dep: $(go_reflect_files) $(BUILDDEPS) @@ -2160,15 +2090,6 @@ regexp/check: $(CHECK_DEPS) @$(CHECK) .PHONY: regexp/check -@go_include@ rpc/rpc.lo.dep -rpc/rpc.lo.dep: $(go_rpc_files) - $(BUILDDEPS) -rpc/rpc.lo: $(go_rpc_files) - $(BUILDPACKAGE) -rpc/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: rpc/check - @go_include@ runtime/runtime.lo.dep runtime/runtime.lo.dep: $(go_runtime_files) $(BUILDDEPS) @@ -2178,23 +2099,15 @@ runtime/check: $(CHECK_DEPS) @$(CHECK) .PHONY: runtime/check -@go_include@ scanner/scanner.lo.dep -scanner/scanner.lo.dep: $(go_scanner_files) +@go_include@ text/scanner.lo.dep +text/scanner.lo.dep: $(go_text_scanner_files) $(BUILDDEPS) -scanner/scanner.lo: $(go_scanner_files) +text/scanner.lo: $(go_text_scanner_files) $(BUILDPACKAGE) -scanner/check: $(CHECK_DEPS) +text/scanner/check: $(CHECK_DEPS) + @$(MKDIR_P) text/scanner @$(CHECK) -.PHONY: scanner/check - -@go_include@ smtp/smtp.lo.dep -smtp/smtp.lo.dep: $(go_smtp_files) - $(BUILDDEPS) -smtp/smtp.lo: $(go_smtp_files) - $(BUILDPACKAGE) -smtp/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: smtp/check +.PHONY: text/scanner/check @go_include@ sort/sort.lo.dep sort/sort.lo.dep: $(go_sort_files) @@ -2232,35 +2145,6 @@ sync/check: $(CHECK_DEPS) @$(CHECK) .PHONY: sync/check -@go_include@ syslog/syslog.lo.dep -syslog/syslog.lo.dep: $(go_syslog_files) - $(BUILDDEPS) -syslog/syslog.lo: $(go_syslog_files) - $(BUILDPACKAGE) -syslog/syslog_c.lo: $(go_syslog_c_files) syslog/syslog.lo - $(LTCOMPILE) -c -o $@ $(srcdir)/go/syslog/syslog_c.c -syslog/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: syslog/check - -@go_include@ tabwriter/tabwriter.lo.dep -tabwriter/tabwriter.lo.dep: $(go_tabwriter_files) - $(BUILDDEPS) -tabwriter/tabwriter.lo: $(go_tabwriter_files) - $(BUILDPACKAGE) -tabwriter/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: tabwriter/check - -@go_include@ template/template.lo.dep -template/template.lo.dep: $(go_template_files) - $(BUILDDEPS) -template/template.lo: $(go_template_files) - $(BUILDPACKAGE) -template/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: template/check - @go_include@ testing/testing.lo.dep testing/testing.lo.dep: $(go_testing_files) $(BUILDDEPS) @@ -2288,33 +2172,6 @@ unicode/check: $(CHECK_DEPS) @$(CHECK) .PHONY: unicode/check -@go_include@ url/url.lo.dep -url/url.lo.dep: $(go_url_files) - $(BUILDDEPS) -url/url.lo: $(go_url_files) - $(BUILDPACKAGE) -url/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: url/check - -@go_include@ utf16/utf16.lo.dep -utf16/utf16.lo.dep: $(go_utf16_files) - $(BUILDDEPS) -utf16/utf16.lo: $(go_utf16_files) - $(BUILDPACKAGE) -utf16/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: utf16/check - -@go_include@ utf8/utf8.lo.dep -utf8/utf8.lo.dep: $(go_utf8_files) - $(BUILDDEPS) -utf8/utf8.lo: $(go_utf8_files) - $(BUILDPACKAGE) -utf8/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: utf8/check - @go_include@ websocket/websocket.lo.dep websocket/websocket.lo.dep: $(go_websocket_files) $(BUILDDEPS) @@ -2324,15 +2181,6 @@ websocket/check: $(CHECK_DEPS) @$(CHECK) .PHONY: websocket/check -@go_include@ xml/xml.lo.dep -xml/xml.lo.dep: $(go_xml_files) - $(BUILDDEPS) -xml/xml.lo: $(go_xml_files) - $(BUILDPACKAGE) -xml/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: xml/check - @go_include@ archive/tar.lo.dep archive/tar.lo.dep: $(go_archive_tar_files) $(BUILDDEPS) @@ -2803,6 +2651,16 @@ debug/pe/check: $(CHECK_DEPS) @$(CHECK) .PHONY: debug/pe/check +@go_include@ encoding/asn1.lo.dep +encoding/asn1.lo.dep: $(go_encoding_asn1_files) + $(BUILDDEPS) +encoding/asn1.lo: $(go_encoding_asn1_files) + $(BUILDPACKAGE) +encoding/asn1/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/asn1 + @$(CHECK) +.PHONY: encoding/asn1/check + @go_include@ encoding/ascii85.lo.dep encoding/ascii85.lo.dep: $(go_encoding_ascii85_files) $(BUILDDEPS) @@ -2843,6 +2701,16 @@ encoding/binary/check: $(CHECK_DEPS) @$(CHECK) .PHONY: encoding/binary/check +@go_include@ encoding/csv.lo.dep +encoding/csv.lo.dep: $(go_encoding_csv_files) + $(BUILDDEPS) +encoding/csv.lo: $(go_encoding_csv_files) + $(BUILDPACKAGE) +encoding/csv/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/csv + @$(CHECK) +.PHONY: encoding/csv/check + @go_include@ encoding/git85.lo.dep encoding/git85.lo.dep: $(go_encoding_git85_files) $(BUILDDEPS) @@ -2853,6 +2721,16 @@ encoding/git85/check: $(CHECK_DEPS) @$(CHECK) .PHONY: encoding/git85/check +@go_include@ encoding/gob.lo.dep +encoding/gob.lo.dep: $(go_encoding_gob_files) + $(BUILDDEPS) +encoding/gob.lo: $(go_encoding_gob_files) + $(BUILDPACKAGE) +encoding/gob/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/gob + @$(CHECK) +.PHONY: encoding/gob/check + @go_include@ encoding/hex.lo.dep encoding/hex.lo.dep: $(go_encoding_hex_files) $(BUILDDEPS) @@ -2863,6 +2741,16 @@ encoding/hex/check: $(CHECK_DEPS) @$(CHECK) .PHONY: encoding/hex/check +@go_include@ encoding/json.lo.dep +encoding/json.lo.dep: $(go_encoding_json_files) + $(BUILDDEPS) +encoding/json.lo: $(go_encoding_json_files) + $(BUILDPACKAGE) +encoding/json/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/json + @$(CHECK) +.PHONY: encoding/json/check + @go_include@ encoding/pem.lo.dep encoding/pem.lo.dep: $(go_encoding_pem_files) $(BUILDDEPS) @@ -2873,6 +2761,16 @@ encoding/pem/check: $(CHECK_DEPS) @$(CHECK) .PHONY: encoding/pem/check +@go_include@ encoding/xml.lo.dep +encoding/xml.lo.dep: $(go_encoding_xml_files) + $(BUILDDEPS) +encoding/xml.lo: $(go_encoding_xml_files) + $(BUILDPACKAGE) +encoding/xml/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/xml + @$(CHECK) +.PHONY: encoding/xml/check + @go_include@ exp/ebnf.lo.dep exp/ebnf.lo.dep: $(go_exp_ebnf_files) $(BUILDDEPS) @@ -2983,15 +2881,15 @@ exp/sql/driver/check: $(CHECK_DEPS) @$(CHECK) .PHONY: exp/sql/driver/check -@go_include@ exp/template/html.lo.dep -exp/template/html.lo.dep: $(go_exp_template_html_files) +@go_include@ html/template.lo.dep +html/template.lo.dep: $(go_html_template_files) $(BUILDDEPS) -exp/template/html.lo: $(go_exp_template_html_files) +html/template.lo: $(go_html_template_files) $(BUILDPACKAGE) -exp/template/html/check: $(CHECK_DEPS) - @$(MKDIR_P) exp/template/html +html/template/check: $(CHECK_DEPS) + @$(MKDIR_P) html/template @$(CHECK) -.PHONY: exp/template/html/check +.PHONY: html/template/check @go_include@ go/ast.lo.dep go/ast.lo.dep: $(go_go_ast_files) @@ -3112,46 +3010,6 @@ hash/fnv/check: $(CHECK_DEPS) @$(CHECK) .PHONY: hash/fnv/check -@go_include@ http/cgi.lo.dep -http/cgi.lo.dep: $(go_http_cgi_files) - $(BUILDDEPS) -http/cgi.lo: $(go_http_cgi_files) - $(BUILDPACKAGE) -http/cgi/check: $(CHECK_DEPS) - @$(MKDIR_P) http/cgi - @$(CHECK) -.PHONY: http/cgi/check - -@go_include@ http/fcgi.lo.dep -http/fcgi.lo.dep: $(go_http_fcgi_files) - $(BUILDDEPS) -http/fcgi.lo: $(go_http_fcgi_files) - $(BUILDPACKAGE) -http/fcgi/check: $(CHECK_DEPS) - @$(MKDIR_P) http/fcgi - @$(CHECK) -.PHONY: http/fcgi/check - -@go_include@ http/httptest.lo.dep -http/httptest.lo.dep: $(go_http_httptest_files) - $(BUILDDEPS) -http/httptest.lo: $(go_http_httptest_files) - $(BUILDPACKAGE) -http/httptest/check: $(CHECK_DEPS) - @$(MKDIR_P) http/httptest - @$(CHECK) -.PHONY: http/httptest/check - -@go_include@ http/pprof.lo.dep -http/pprof.lo.dep: $(go_http_pprof_files) - $(BUILDDEPS) -http/pprof.lo: $(go_http_pprof_files) - $(BUILDPACKAGE) -http/pprof/check: $(CHECK_DEPS) - @$(MKDIR_P) http/pprof - @$(CHECK) -.PHONY: http/pprof/check - @go_include@ image/bmp.lo.dep image/bmp.lo.dep: $(go_image_bmp_files) $(BUILDDEPS) @@ -3252,6 +3110,48 @@ io/ioutil/check: $(CHECK_DEPS) @$(CHECK) .PHONY: io/ioutil/check +@go_include@ log/syslog.lo.dep +log/syslog.lo.dep: $(go_log_syslog_files) + $(BUILDDEPS) +log/syslog.lo: $(go_log_syslog_files) + $(BUILDPACKAGE) +log/syslog/syslog_c.lo: $(go_syslog_c_files) log/syslog.lo + $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c +log/syslog/check: $(CHECK_DEPS) + @$(MKDIR_P) log/syslog + @$(CHECK) +.PHONY: log/syslog/check + +@go_include@ math/big.lo.dep +math/big.lo.dep: $(go_math_big_files) + $(BUILDDEPS) +math/big.lo: $(go_math_big_files) + $(BUILDPACKAGE) +math/big/check: $(CHECK_DEPS) + @$(MKDIR_P) math/big + @$(CHECK) +.PHONY: math/big/check + +@go_include@ math/cmplx.lo.dep +math/cmplx.lo.dep: $(go_math_cmplx_files) + $(BUILDDEPS) +math/cmplx.lo: $(go_math_cmplx_files) + $(BUILDPACKAGE) +math/cmplx/check: $(CHECK_DEPS) + @$(MKDIR_P) math/cmplx + @$(CHECK) +.PHONY: math/cmplx/check + +@go_include@ math/rand.lo.dep +math/rand.lo.dep: $(go_math_rand_files) + $(BUILDDEPS) +math/rand.lo: $(go_math_rand_files) + $(BUILDPACKAGE) +math/rand/check: $(CHECK_DEPS) + @$(MKDIR_P) math/rand + @$(CHECK) +.PHONY: math/rand/check + @go_include@ mime/multipart.lo.dep mime/multipart.lo.dep: $(go_mime_multipart_files) $(BUILDDEPS) @@ -3268,6 +3168,56 @@ net/dict.lo.dep: $(go_net_dict_files) net/dict.lo: $(go_net_dict_files) $(BUILDPACKAGE) +@go_include@ net/http.lo.dep +net/http.lo.dep: $(go_net_http_files) + $(BUILDDEPS) +net/http.lo: $(go_net_http_files) + $(BUILDPACKAGE) +net/http/check: $(CHECK_DEPS) + @$(MKDIR_P) net/http + @$(CHECK) +.PHONY: net/http/check + +@go_include@ net/mail.lo.dep +net/mail.lo.dep: $(go_net_mail_files) + $(BUILDDEPS) +net/mail.lo: $(go_net_mail_files) + $(BUILDPACKAGE) +net/mail/check: $(CHECK_DEPS) + @$(MKDIR_P) net/mail + @$(CHECK) +.PHONY: net/mail/check + +@go_include@ net/rpc.lo.dep +net/rpc.lo.dep: $(go_net_rpc_files) + $(BUILDDEPS) +net/rpc.lo: $(go_net_rpc_files) + $(BUILDPACKAGE) +net/rpc/check: $(CHECK_DEPS) + @$(MKDIR_P) net/rpc + @$(CHECK) +.PHONY: net/rpc/check + +@go_include@ net/smtp.lo.dep +net/smtp.lo.dep: $(go_net_smtp_files) + $(BUILDDEPS) +net/smtp.lo: $(go_net_smtp_files) + $(BUILDPACKAGE) +net/smtp/check: $(CHECK_DEPS) + @$(MKDIR_P) net/smtp + @$(CHECK) +.PHONY: net/smtp/check + +@go_include@ net/url.lo.dep +net/url.lo.dep: $(go_net_url_files) + $(BUILDDEPS) +net/url.lo: $(go_net_url_files) + $(BUILDPACKAGE) +net/url/check: $(CHECK_DEPS) + @$(MKDIR_P) net/url + @$(CHECK) +.PHONY: net/url/check + @go_include@ net/textproto.lo.dep net/textproto.lo.dep: $(go_net_textproto_files) $(BUILDDEPS) @@ -3278,6 +3228,66 @@ net/textproto/check: $(CHECK_DEPS) @$(CHECK) .PHONY: net/textproto/check +@go_include@ net/http/cgi.lo.dep +net/http/cgi.lo.dep: $(go_net_http_cgi_files) + $(BUILDDEPS) +net/http/cgi.lo: $(go_net_http_cgi_files) + $(BUILDPACKAGE) +net/http/cgi/check: $(CHECK_DEPS) + @$(MKDIR_P) net/http/cgi + @$(CHECK) +.PHONY: net/http/cgi/check + +@go_include@ net/http/fcgi.lo.dep +net/http/fcgi.lo.dep: $(go_net_http_fcgi_files) + $(BUILDDEPS) +net/http/fcgi.lo: $(go_net_http_fcgi_files) + $(BUILDPACKAGE) +net/http/fcgi/check: $(CHECK_DEPS) + @$(MKDIR_P) net/http/fcgi + @$(CHECK) +.PHONY: net/http/fcgi/check + +@go_include@ net/http/httptest.lo.dep +net/http/httptest.lo.dep: $(go_net_http_httptest_files) + $(BUILDDEPS) +net/http/httptest.lo: $(go_net_http_httptest_files) + $(BUILDPACKAGE) +net/http/httptest/check: $(check_deps) + @$(MKDIR_P) net/http/httptest + @$(CHECK) +.PHONY: net/http/httptest/check + +@go_include@ net/http/httputil.lo.dep +net/http/httputil.lo.dep: $(go_net_http_httputil_files) + $(BUILDDEPS) +net/http/httputil.lo: $(go_net_http_httputil_files) + $(BUILDPACKAGE) +net/http/httputil/check: $(check_deps) + @$(MKDIR_P) net/http/httputil + @$(CHECK) +.PHONY: net/http/httputil/check + +@go_include@ net/http/pprof.lo.dep +net/http/pprof.lo.dep: $(go_net_http_pprof_files) + $(BUILDDEPS) +net/http/pprof.lo: $(go_net_http_pprof_files) + $(BUILDPACKAGE) +net/http/pprof/check: $(CHECK_DEPS) + @$(MKDIR_P) net/http/pprof + @$(CHECK) +.PHONY: net/http/pprof/check + +@go_include@ net/rpc/jsonrpc.lo.dep +net/rpc/jsonrpc.lo.dep: $(go_net_rpc_jsonrpc_files) + $(BUILDDEPS) +net/rpc/jsonrpc.lo: $(go_net_rpc_jsonrpc_files) + $(BUILDPACKAGE) +net/rpc/jsonrpc/check: $(CHECK_DEPS) + @$(MKDIR_P) net/rpc/jsonrpc + @$(CHECK) +.PHONY: net/rpc/jsonrpc/check + @go_include@ old/netchan.lo.dep old/netchan.lo.dep: $(go_old_netchan_files) $(BUILDDEPS) @@ -3308,6 +3318,16 @@ old/template/check: $(CHECK_DEPS) @$(CHECK) .PHONY: old/template/check +@go_include@ os/exec.lo.dep +os/exec.lo.dep: $(go_os_exec_files) + $(BUILDDEPS) +os/exec.lo: $(go_os_exec_files) + $(BUILDPACKAGE) +os/exec/check: $(CHECK_DEPS) + @$(MKDIR_P) os/exec + @$(CHECK) +.PHONY: os/exec/check + @go_include@ os/user.lo.dep os/user.lo.dep: $(go_os_user_files) $(BUILDDEPS) @@ -3348,16 +3368,6 @@ regexp/syntax/check: $(CHECK_DEPS) @$(CHECK) .PHONY: regexp/syntax/check -@go_include@ rpc/jsonrpc.lo.dep -rpc/jsonrpc.lo.dep: $(go_rpc_jsonrpc_files) - $(BUILDDEPS) -rpc/jsonrpc.lo: $(go_rpc_jsonrpc_files) - $(BUILDPACKAGE) -rpc/jsonrpc/check: $(CHECK_DEPS) - @$(MKDIR_P) rpc/jsonrpc - @$(CHECK) -.PHONY: rpc/jsonrpc/check - @go_include@ runtime/debug.lo.dep runtime/debug.lo.dep: $(go_runtime_debug_files) $(BUILDDEPS) @@ -3390,15 +3400,34 @@ sync/atomic/check: $(CHECK_DEPS) @$(CHECK) .PHONY: sync/atomic/check -@go_include@ template/parse.lo.dep -template/parse.lo.dep: $(go_template_parse_files) +@go_include@ text/tabwriter.lo.dep +text/tabwriter.lo.dep: $(go_text_tabwriter_files) $(BUILDDEPS) -template/parse.lo: $(go_template_parse_files) +text/tabwriter.lo: $(go_text_tabwriter_files) $(BUILDPACKAGE) -template/parse/check: $(CHECK_DEPS) - @$(MKDIR_P) template/parse +text/tabwriter/check: $(CHECK_DEPS) + @$(MKDIR_P) text/tabwriter @$(CHECK) -.PHONY: template/parse/check +.PHONY: text/tabwriter/check + +@go_include@ text/template.lo.dep +text/template.lo.dep: $(go_text_template_files) + $(BUILDDEPS) +text/template.lo: $(go_text_template_files) + $(BUILDPACKAGE) +text/template/check: $(CHECK_DEPS) + @$(CHECK) +.PHONY: text/template/check + +@go_include@ text/template/parse.lo.dep +text/template/parse.lo.dep: $(go_text_template_parse_files) + $(BUILDDEPS) +text/template/parse.lo: $(go_text_template_parse_files) + $(BUILDPACKAGE) +text/template/parse/check: $(CHECK_DEPS) + @$(MKDIR_P) text/template/parse + @$(CHECK) +.PHONY: text/template/parse/check @go_include@ testing/iotest.lo.dep testing/iotest.lo.dep: $(go_testing_iotest_files) @@ -3430,6 +3459,26 @@ testing/script/check: $(CHECK_DEPS) @$(CHECK) .PHONY: testing/script/check +@go_include@ unicode/utf16.lo.dep +unicode/utf16.lo.dep: $(go_unicode_utf16_files) + $(BUILDDEPS) +unicode/utf16.lo: $(go_unicode_utf16_files) + $(BUILDPACKAGE) +unicode/utf16/check: $(CHECK_DEPS) + @$(MKDIR_P) unicode/utf16 + @$(CHECK) +.PHONY: unicode/utf16/check + +@go_include@ unicode/utf8.lo.dep +unicode/utf8.lo.dep: $(go_unicode_utf8_files) + $(BUILDDEPS) +unicode/utf8.lo: $(go_unicode_utf8_files) + $(BUILDPACKAGE) +unicode/utf8/check: $(CHECK_DEPS) + @$(MKDIR_P) unicode/utf8 + @$(CHECK) +.PHONY: unicode/utf8/check + @go_include@ syscall/syscall.lo.dep syscall/syscall.lo.dep: $(go_syscall_files) $(BUILDDEPS) @@ -3445,50 +3494,32 @@ BUILDGOX = \ f=`echo $< | sed -e 's/.lo$$/.o/'`; \ $(OBJCOPY) -j .go_export $$f $@.tmp && mv -f $@.tmp $@ -asn1.gox: asn1/asn1.lo - $(BUILDGOX) -big.gox: big/big.lo - $(BUILDGOX) bufio.gox: bufio/bufio.lo $(BUILDGOX) bytes.gox: bytes/bytes.lo $(BUILDGOX) -cmath.gox: cmath/cmath.lo - $(BUILDGOX) crypto.gox: crypto/crypto.lo $(BUILDGOX) -csv.gox: csv/csv.lo - $(BUILDGOX) errors.gox: errors/errors.lo $(BUILDGOX) -exec.gox: exec/exec.lo - $(BUILDGOX) expvar.gox: expvar/expvar.lo $(BUILDGOX) flag.gox: flag/flag.lo $(BUILDGOX) fmt.gox: fmt/fmt.lo $(BUILDGOX) -gob.gox: gob/gob.lo - $(BUILDGOX) hash.gox: hash/hash.lo $(BUILDGOX) html.gox: html/html.lo $(BUILDGOX) -http.gox: http/http.lo - $(BUILDGOX) image.gox: image/image.lo $(BUILDGOX) io.gox: io/io.lo $(BUILDGOX) -json.gox: json/json.lo - $(BUILDGOX) log.gox: log/log.lo $(BUILDGOX) math.gox: math/math.lo $(BUILDGOX) -mail.gox: mail/mail.lo - $(BUILDGOX) mime.gox: mime/mime.lo $(BUILDGOX) net.gox: net/net.lo @@ -3499,20 +3530,12 @@ patch.gox: patch/patch.lo $(BUILDGOX) path.gox: path/path.lo $(BUILDGOX) -rand.gox: rand/rand.lo - $(BUILDGOX) reflect.gox: reflect/reflect.lo $(BUILDGOX) regexp.gox: regexp/regexp.lo $(BUILDGOX) -rpc.gox: rpc/rpc.lo - $(BUILDGOX) runtime.gox: runtime/runtime.lo $(BUILDGOX) -scanner.gox: scanner/scanner.lo - $(BUILDGOX) -smtp.gox: smtp/smtp.lo - $(BUILDGOX) sort.gox: sort/sort.lo $(BUILDGOX) strconv.gox: strconv/strconv.lo @@ -3521,30 +3544,16 @@ strings.gox: strings/strings.lo $(BUILDGOX) sync.gox: sync/sync.lo $(BUILDGOX) -syslog.gox: syslog/syslog.lo - $(BUILDGOX) syscall.gox: syscall/syscall.lo $(BUILDGOX) -tabwriter.gox: tabwriter/tabwriter.lo - $(BUILDGOX) -template.gox: template/template.lo - $(BUILDGOX) testing.gox: testing/testing.lo $(BUILDGOX) time.gox: time/time.lo $(BUILDGOX) unicode.gox: unicode/unicode.lo $(BUILDGOX) -url.gox: url/url.lo - $(BUILDGOX) -utf16.gox: utf16/utf16.lo - $(BUILDGOX) -utf8.gox: utf8/utf8.lo - $(BUILDGOX) websocket.gox: websocket/websocket.lo $(BUILDGOX) -xml.gox: xml/xml.lo - $(BUILDGOX) archive/tar.gox: archive/tar.lo $(BUILDGOX) @@ -3649,18 +3658,28 @@ debug/pe.gox: debug/pe.lo encoding/ascii85.gox: encoding/ascii85.lo $(BUILDGOX) +encoding/asn1.gox: encoding/asn1.lo + $(BUILDGOX) encoding/base32.gox: encoding/base32.lo $(BUILDGOX) encoding/base64.gox: encoding/base64.lo $(BUILDGOX) encoding/binary.gox: encoding/binary.lo $(BUILDGOX) +encoding/csv.gox: encoding/csv.lo + $(BUILDGOX) encoding/git85.gox: encoding/git85.lo $(BUILDGOX) +encoding/gob.gox: encoding/gob.lo + $(BUILDGOX) encoding/hex.gox: encoding/hex.lo $(BUILDGOX) +encoding/json.gox: encoding/json.lo + $(BUILDGOX) encoding/pem.gox: encoding/pem.lo $(BUILDGOX) +encoding/xml.gox: encoding/xml.lo + $(BUILDGOX) exp/ebnf.gox: exp/ebnf.lo $(BUILDGOX) @@ -3687,7 +3706,7 @@ exp/gui/x11.gox: exp/gui/x11.lo exp/sql/driver.gox: exp/sql/driver.lo $(BUILDGOX) -exp/template/html.gox: exp/template/html.lo +html/template.gox: html/template.lo $(BUILDGOX) go/ast.gox: go/ast.lo @@ -3714,15 +3733,6 @@ hash/crc64.gox: hash/crc64.lo hash/fnv.gox: hash/fnv.lo $(BUILDGOX) -http/cgi.gox: http/cgi.lo - $(BUILDGOX) -http/fcgi.gox: http/fcgi.lo - $(BUILDGOX) -http/httptest.gox: http/httptest.lo - $(BUILDGOX) -http/pprof.gox: http/pprof.lo - $(BUILDGOX) - image/bmp.gox: image/bmp.lo $(BUILDGOX) image/color.gox: image/color.lo @@ -3746,13 +3756,47 @@ index/suffixarray.gox: index/suffixarray.lo io/ioutil.gox: io/ioutil.lo $(BUILDGOX) +log/syslog.gox: log/syslog.lo + $(BUILDGOX) + +math/big.gox: math/big.lo + $(BUILDGOX) +math/cmplx.gox: math/cmplx.lo + $(BUILDGOX) +math/rand.gox: math/rand.lo + $(BUILDGOX) + mime/multipart.gox: mime/multipart.lo $(BUILDGOX) net/dict.gox: net/dict.lo $(BUILDGOX) +net/http.gox: net/http.lo + $(BUILDGOX) +net/mail.gox: net/mail.lo + $(BUILDGOX) +net/rpc.gox: net/rpc.lo + $(BUILDGOX) +net/smtp.gox: net/smtp.lo + $(BUILDGOX) net/textproto.gox: net/textproto.lo $(BUILDGOX) +net/url.gox: net/url.lo + $(BUILDGOX) + +net/http/cgi.gox: net/http/cgi.lo + $(BUILDGOX) +net/http/fcgi.gox: net/http/fcgi.lo + $(BUILDGOX) +net/http/httptest.gox: net/http/httptest.lo + $(BUILDGOX) +net/http/httputil.gox: net/http/httputil.lo + $(BUILDGOX) +net/http/pprof.gox: net/http/pprof.lo + $(BUILDGOX) + +net/rpc/jsonrpc.gox: net/rpc/jsonrpc.lo + $(BUILDGOX) old/netchan.gox: old/netchan.lo $(BUILDGOX) @@ -3761,6 +3805,8 @@ old/regexp.gox: old/regexp.lo old/template.gox: old/template.lo $(BUILDGOX) +os/exec.gox: os/exec.lo + $(BUILDGOX) os/user.gox: os/user.lo $(BUILDGOX) os/signal.gox: os/signal.lo @@ -3772,9 +3818,6 @@ path/filepath.gox: path/filepath.lo regexp/syntax.gox: regexp/syntax.lo $(BUILDGOX) -rpc/jsonrpc.gox: rpc/jsonrpc.lo - $(BUILDGOX) - runtime/debug.gox: runtime/debug.lo $(BUILDGOX) runtime/pprof.gox: runtime/pprof.lo @@ -3783,7 +3826,13 @@ runtime/pprof.gox: runtime/pprof.lo sync/atomic.gox: sync/atomic.lo $(BUILDGOX) -template/parse.gox: template/parse.lo +text/scanner.gox: text/scanner.lo + $(BUILDGOX) +text/tabwriter.gox: text/tabwriter.lo + $(BUILDGOX) +text/template.gox: text/template.lo + $(BUILDGOX) +text/template/parse.gox: text/template/parse.lo $(BUILDGOX) testing/iotest.gox: testing/iotest.lo @@ -3793,6 +3842,11 @@ testing/quick.gox: testing/quick.lo testing/script.gox: testing/script.lo $(BUILDGOX) +unicode/utf16.gox: unicode/utf16.lo + $(BUILDGOX) +unicode/utf8.gox: unicode/utf8.lo + $(BUILDGOX) + if LIBGO_IS_LINUX # exp_inotify_check = exp/inotify/check exp_inotify_check = @@ -3801,52 +3855,32 @@ exp_inotify_check = endif TEST_PACKAGES = \ - asn1/check \ - big/check \ bufio/check \ bytes/check \ - cmath/check \ - csv/check \ errors/check \ - exec/check \ expvar/check \ flag/check \ fmt/check \ - gob/check \ html/check \ - http/check \ image/check \ io/check \ - json/check \ log/check \ math/check \ - mail/check \ mime/check \ net/check \ os/check \ patch/check \ path/check \ - rand/check \ reflect/check \ regexp/check \ - rpc/check \ runtime/check \ - scanner/check \ - smtp/check \ sort/check \ strconv/check \ strings/check \ sync/check \ - syslog/check \ - tabwriter/check \ - template/check \ time/check \ unicode/check \ - url/check \ - utf16/check \ - utf8/check \ websocket/check \ - xml/check \ archive/tar/check \ archive/zip/check \ compress/bzip2/check \ @@ -3892,12 +3926,17 @@ TEST_PACKAGES = \ debug/macho/check \ debug/pe/check \ encoding/ascii85/check \ + encoding/asn1/check \ encoding/base32/check \ encoding/base64/check \ encoding/binary/check \ + encoding/csv/check \ encoding/git85/check \ + encoding/gob/check \ encoding/hex/check \ + encoding/json/check \ encoding/pem/check \ + encoding/xml/check \ exp/ebnf/check \ $(exp_inotify_check) \ exp/norm/check \ @@ -3905,7 +3944,7 @@ TEST_PACKAGES = \ exp/sql/check \ exp/ssh/check \ exp/terminal/check \ - exp/template/html/check \ + html/template/check \ go/ast/check \ $(go_build_check_omitted_since_it_calls_6g) \ go/parser/check \ @@ -3917,8 +3956,6 @@ TEST_PACKAGES = \ hash/crc32/check \ hash/crc64/check \ hash/fnv/check \ - http/cgi/check \ - http/fcgi/check \ image/draw/check \ image/jpeg/check \ image/png/check \ @@ -3926,20 +3963,38 @@ TEST_PACKAGES = \ image/ycbcr/check \ index/suffixarray/check \ io/ioutil/check \ + log/syslog/check \ + math/big/check \ + math/cmplx/check \ + math/rand/check \ mime/multipart/check \ + net/http/check \ + net/http/cgi/check \ + net/http/fcgi/check \ + net/http/httputil/check \ + net/mail/check \ + net/rpc/check \ + net/smtp/check \ net/textproto/check \ + net/url/check \ + net/rpc/jsonrpc/check \ old/netchan/check \ old/regexp/check \ old/template/check \ + os/exec/check \ os/user/check \ os/signal/check \ path/filepath/check \ regexp/syntax/check \ - rpc/jsonrpc/check \ sync/atomic/check \ - template/parse/check \ + text/scanner/check \ + text/tabwriter/check \ + text/template/check \ + text/template/parse/check \ testing/quick/check \ - testing/script/check + testing/script/check \ + unicode/utf16/check \ + unicode/utf8/check check: check-tail check-recursive: check-head diff --git a/libgo/Makefile.in b/libgo/Makefile.in index 4cb4b5fc556..11b86509e6f 100644 --- a/libgo/Makefile.in +++ b/libgo/Makefile.in @@ -104,24 +104,28 @@ am__installdirs = "$(DESTDIR)$(toolexeclibdir)" \ "$(DESTDIR)$(toolexeclibgoexpdir)" \ "$(DESTDIR)$(toolexeclibgoexpguidir)" \ "$(DESTDIR)$(toolexeclibgoexpsqldir)" \ - "$(DESTDIR)$(toolexeclibgoexptemplatedir)" \ "$(DESTDIR)$(toolexeclibgogodir)" \ "$(DESTDIR)$(toolexeclibgohashdir)" \ - "$(DESTDIR)$(toolexeclibgohttpdir)" \ + "$(DESTDIR)$(toolexeclibgohtmldir)" \ "$(DESTDIR)$(toolexeclibgoimagedir)" \ "$(DESTDIR)$(toolexeclibgoindexdir)" \ "$(DESTDIR)$(toolexeclibgoiodir)" \ + "$(DESTDIR)$(toolexeclibgologdir)" \ + "$(DESTDIR)$(toolexeclibgomathdir)" \ "$(DESTDIR)$(toolexeclibgomimedir)" \ "$(DESTDIR)$(toolexeclibgonetdir)" \ + "$(DESTDIR)$(toolexeclibgonethttpdir)" \ + "$(DESTDIR)$(toolexeclibgonetrpcdir)" \ "$(DESTDIR)$(toolexeclibgoolddir)" \ "$(DESTDIR)$(toolexeclibgoosdir)" \ "$(DESTDIR)$(toolexeclibgopathdir)" \ "$(DESTDIR)$(toolexeclibgoregexpdir)" \ - "$(DESTDIR)$(toolexeclibgorpcdir)" \ "$(DESTDIR)$(toolexeclibgoruntimedir)" \ "$(DESTDIR)$(toolexeclibgosyncdir)" \ - "$(DESTDIR)$(toolexeclibgotemplatedir)" \ - "$(DESTDIR)$(toolexeclibgotestingdir)" + "$(DESTDIR)$(toolexeclibgotestingdir)" \ + "$(DESTDIR)$(toolexeclibgotextdir)" \ + "$(DESTDIR)$(toolexeclibgotexttemplatedir)" \ + "$(DESTDIR)$(toolexeclibgounicodedir)" LIBRARIES = $(toolexeclib_LIBRARIES) ARFLAGS = cru libgobegin_a_AR = $(AR) $(ARFLAGS) @@ -130,27 +134,22 @@ am_libgobegin_a_OBJECTS = go-main.$(OBJEXT) libgobegin_a_OBJECTS = $(am_libgobegin_a_OBJECTS) LTLIBRARIES = $(toolexeclib_LTLIBRARIES) am__DEPENDENCIES_1 = -am__DEPENDENCIES_2 = asn1/asn1.lo big/big.lo bufio/bufio.lo \ - bytes/bytes.lo bytes/index.lo cmath/cmath.lo crypto/crypto.lo \ - csv/csv.lo errors/errors.lo exec/exec.lo expvar/expvar.lo \ - flag/flag.lo fmt/fmt.lo gob/gob.lo hash/hash.lo html/html.lo \ - http/http.lo image/image.lo io/io.lo json/json.lo log/log.lo \ - math/math.lo mail/mail.lo mime/mime.lo net/net.lo os/os.lo \ - patch/patch.lo path/path.lo rand/rand.lo reflect/reflect.lo \ - regexp/regexp.lo rpc/rpc.lo runtime/runtime.lo \ - scanner/scanner.lo smtp/smtp.lo sort/sort.lo \ - strconv/strconv.lo strings/strings.lo sync/sync.lo \ - syslog/syslog.lo syslog/syslog_c.lo tabwriter/tabwriter.lo \ - template/template.lo time/time.lo unicode/unicode.lo \ - url/url.lo utf16/utf16.lo utf8/utf8.lo websocket/websocket.lo \ - xml/xml.lo archive/tar.lo archive/zip.lo compress/bzip2.lo \ - compress/flate.lo compress/gzip.lo compress/lzw.lo \ - compress/zlib.lo container/heap.lo container/list.lo \ - container/ring.lo crypto/aes.lo crypto/bcrypt.lo \ - crypto/blowfish.lo crypto/cast5.lo crypto/cipher.lo \ - crypto/des.lo crypto/dsa.lo crypto/ecdsa.lo crypto/elliptic.lo \ - crypto/hmac.lo crypto/md4.lo crypto/md5.lo crypto/ocsp.lo \ - crypto/openpgp.lo crypto/rand.lo crypto/rc4.lo \ +am__DEPENDENCIES_2 = bufio/bufio.lo bytes/bytes.lo bytes/index.lo \ + crypto/crypto.lo errors/errors.lo expvar/expvar.lo \ + flag/flag.lo fmt/fmt.lo hash/hash.lo html/html.lo \ + image/image.lo io/io.lo log/log.lo math/math.lo net/net.lo \ + os/exec.lo os/os.lo patch/patch.lo path/path.lo \ + reflect/reflect.lo regexp/regexp.lo runtime/runtime.lo \ + sort/sort.lo strconv/strconv.lo strings/strings.lo \ + sync/sync.lo time/time.lo unicode/unicode.lo \ + websocket/websocket.lo archive/tar.lo archive/zip.lo \ + compress/bzip2.lo compress/flate.lo compress/gzip.lo \ + compress/lzw.lo compress/zlib.lo container/heap.lo \ + container/list.lo container/ring.lo crypto/aes.lo \ + crypto/bcrypt.lo crypto/blowfish.lo crypto/cast5.lo \ + crypto/cipher.lo crypto/des.lo crypto/dsa.lo crypto/ecdsa.lo \ + crypto/elliptic.lo crypto/hmac.lo crypto/md4.lo crypto/md5.lo \ + crypto/ocsp.lo crypto/openpgp.lo crypto/rand.lo crypto/rc4.lo \ crypto/ripemd160.lo crypto/rsa.lo crypto/sha1.lo \ crypto/sha256.lo crypto/sha512.lo crypto/subtle.lo \ crypto/tls.lo crypto/twofish.lo crypto/x509.lo crypto/xtea.lo \ @@ -158,24 +157,31 @@ am__DEPENDENCIES_2 = asn1/asn1.lo big/big.lo bufio/bufio.lo \ crypto/openpgp/error.lo crypto/openpgp/packet.lo \ crypto/openpgp/s2k.lo crypto/x509/pkix.lo debug/dwarf.lo \ debug/elf.lo debug/gosym.lo debug/macho.lo debug/pe.lo \ - encoding/ascii85.lo encoding/base32.lo encoding/base64.lo \ - encoding/binary.lo encoding/git85.lo encoding/hex.lo \ - encoding/pem.lo exp/ebnf.lo exp/gui.lo exp/norm.lo exp/spdy.lo \ - exp/sql.lo exp/ssh.lo exp/terminal.lo exp/types.lo \ - exp/gui/x11.lo exp/sql/driver.lo exp/template/html.lo \ - go/ast.lo go/build.lo go/doc.lo go/parser.lo go/printer.lo \ - go/scanner.lo go/token.lo hash/adler32.lo hash/crc32.lo \ - hash/crc64.lo hash/fnv.lo http/cgi.lo http/fcgi.lo \ - http/httptest.lo http/pprof.lo image/bmp.lo image/color.lo \ - image/draw.lo image/gif.lo image/jpeg.lo image/png.lo \ - image/tiff.lo image/ycbcr.lo index/suffixarray.lo io/ioutil.lo \ - mime/multipart.lo net/dict.lo net/textproto.lo old/netchan.lo \ - old/regexp.lo old/template.lo $(am__DEPENDENCIES_1) os/user.lo \ - os/signal.lo path/filepath.lo regexp/syntax.lo rpc/jsonrpc.lo \ - runtime/debug.lo runtime/pprof.lo sync/atomic.lo \ - sync/atomic_c.lo syscall/syscall.lo syscall/errno.lo \ - syscall/wait.lo template/parse.lo testing/testing.lo \ - testing/iotest.lo testing/quick.lo testing/script.lo + encoding/ascii85.lo encoding/asn1.lo encoding/base32.lo \ + encoding/base64.lo encoding/binary.lo encoding/csv.lo \ + encoding/git85.lo encoding/gob.lo encoding/hex.lo \ + encoding/json.lo encoding/pem.lo encoding/xml.lo exp/ebnf.lo \ + exp/gui.lo exp/norm.lo exp/spdy.lo exp/sql.lo exp/ssh.lo \ + exp/terminal.lo exp/types.lo exp/gui/x11.lo exp/sql/driver.lo \ + html/template.lo go/ast.lo go/build.lo go/doc.lo go/parser.lo \ + go/printer.lo go/scanner.lo go/token.lo hash/adler32.lo \ + hash/crc32.lo hash/crc64.lo hash/fnv.lo net/http/cgi.lo \ + net/http/fcgi.lo net/http/httptest.lo net/http/httputil.lo \ + net/http/pprof.lo image/bmp.lo image/color.lo image/draw.lo \ + image/gif.lo image/jpeg.lo image/png.lo image/tiff.lo \ + image/ycbcr.lo index/suffixarray.lo io/ioutil.lo log/syslog.lo \ + log/syslog/syslog_c.lo math/big.lo math/cmplx.lo math/rand.lo \ + mime/mime.lo mime/multipart.lo net/dict.lo net/http.lo \ + net/mail.lo net/rpc.lo net/smtp.lo net/textproto.lo net/url.lo \ + old/netchan.lo old/regexp.lo old/template.lo \ + $(am__DEPENDENCIES_1) os/user.lo os/signal.lo path/filepath.lo \ + regexp/syntax.lo net/rpc/jsonrpc.lo runtime/debug.lo \ + runtime/pprof.lo sync/atomic.lo sync/atomic_c.lo \ + syscall/syscall.lo syscall/errno.lo syscall/wait.lo \ + text/scanner.lo text/tabwriter.lo text/template.lo \ + text/template/parse.lo testing/testing.lo testing/iotest.lo \ + testing/quick.lo testing/script.lo unicode/utf16.lo \ + unicode/utf8.lo libgo_la_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) @@ -216,7 +222,7 @@ am__libgo_la_SOURCES_DIST = runtime/go-append.c runtime/go-assert.c \ runtime/mheap.c runtime/msize.c runtime/proc.c \ runtime/runtime.c runtime/thread.c runtime/yield.c \ runtime/rtems-task-variable-add.c iface.c malloc.c map.c \ - mprof.c reflect.c runtime1.c sema.c sigqueue.c string.c + mprof.c reflect.c runtime1.c sema.c sigqueue.c string.c time.c @LIBGO_IS_LINUX_FALSE@am__objects_1 = lock_sema.lo thread-sema.lo @LIBGO_IS_LINUX_TRUE@am__objects_1 = lock_futex.lo thread-linux.lo @HAVE_SYS_MMAN_H_FALSE@am__objects_2 = mem_posix_memalign.lo @@ -245,7 +251,7 @@ am__objects_4 = go-append.lo go-assert.lo go-assert-interface.lo \ mfinal.lo mfixalloc.lo mgc0.lo mheap.lo msize.lo proc.lo \ runtime.lo thread.lo yield.lo $(am__objects_3) iface.lo \ malloc.lo map.lo mprof.lo reflect.lo runtime1.lo sema.lo \ - sigqueue.lo string.lo + sigqueue.lo string.lo time.lo am_libgo_la_OBJECTS = $(am__objects_4) libgo_la_OBJECTS = $(am_libgo_la_OBJECTS) libgo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -285,15 +291,17 @@ DATA = $(toolexeclibgo_DATA) $(toolexeclibgoarchive_DATA) \ $(toolexeclibgocryptox509_DATA) $(toolexeclibgodebug_DATA) \ $(toolexeclibgoencoding_DATA) $(toolexeclibgoexp_DATA) \ $(toolexeclibgoexpgui_DATA) $(toolexeclibgoexpsql_DATA) \ - $(toolexeclibgoexptemplate_DATA) $(toolexeclibgogo_DATA) \ - $(toolexeclibgohash_DATA) $(toolexeclibgohttp_DATA) \ - $(toolexeclibgoimage_DATA) $(toolexeclibgoindex_DATA) \ - $(toolexeclibgoio_DATA) $(toolexeclibgomime_DATA) \ - $(toolexeclibgonet_DATA) $(toolexeclibgoold_DATA) \ - $(toolexeclibgoos_DATA) $(toolexeclibgopath_DATA) \ - $(toolexeclibgoregexp_DATA) $(toolexeclibgorpc_DATA) \ + $(toolexeclibgogo_DATA) $(toolexeclibgohash_DATA) \ + $(toolexeclibgohtml_DATA) $(toolexeclibgoimage_DATA) \ + $(toolexeclibgoindex_DATA) $(toolexeclibgoio_DATA) \ + $(toolexeclibgolog_DATA) $(toolexeclibgomath_DATA) \ + $(toolexeclibgomime_DATA) $(toolexeclibgonet_DATA) \ + $(toolexeclibgonethttp_DATA) $(toolexeclibgonetrpc_DATA) \ + $(toolexeclibgoold_DATA) $(toolexeclibgoos_DATA) \ + $(toolexeclibgopath_DATA) $(toolexeclibgoregexp_DATA) \ $(toolexeclibgoruntime_DATA) $(toolexeclibgosync_DATA) \ - $(toolexeclibgotemplate_DATA) $(toolexeclibgotesting_DATA) + $(toolexeclibgotesting_DATA) $(toolexeclibgotext_DATA) \ + $(toolexeclibgotexttemplate_DATA) $(toolexeclibgounicode_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ @@ -561,56 +569,36 @@ toolexeclib_LTLIBRARIES = libgo.la toolexeclib_LIBRARIES = libgobegin.a toolexeclibgodir = $(toolexeclibdir)/go/$(gcc_version)/$(target_alias) toolexeclibgo_DATA = \ - asn1.gox \ - big.gox \ bufio.gox \ bytes.gox \ - cmath.gox \ crypto.gox \ - csv.gox \ errors.gox \ - exec.gox \ expvar.gox \ flag.gox \ fmt.gox \ - gob.gox \ hash.gox \ html.gox \ - http.gox \ image.gox \ io.gox \ - json.gox \ log.gox \ math.gox \ - mail.gox \ mime.gox \ net.gox \ os.gox \ patch.gox \ path.gox \ - rand.gox \ reflect.gox \ regexp.gox \ - rpc.gox \ runtime.gox \ - scanner.gox \ - smtp.gox \ sort.gox \ strconv.gox \ strings.gox \ sync.gox \ syscall.gox \ - syslog.gox \ - tabwriter.gox \ - template.gox \ testing.gox \ time.gox \ unicode.gox \ - url.gox \ - utf16.gox \ - utf8.gox \ - websocket.gox \ - xml.gox + websocket.gox toolexeclibgoarchivedir = $(toolexeclibgodir)/archive toolexeclibgoarchive_DATA = \ @@ -683,12 +671,17 @@ toolexeclibgodebug_DATA = \ toolexeclibgoencodingdir = $(toolexeclibgodir)/encoding toolexeclibgoencoding_DATA = \ encoding/ascii85.gox \ + encoding/asn1.gox \ encoding/base32.gox \ encoding/base64.gox \ encoding/binary.gox \ + encoding/csv.gox \ encoding/git85.gox \ + encoding/gob.gox \ encoding/hex.gox \ - encoding/pem.gox + encoding/json.gox \ + encoding/pem.gox \ + encoding/xml.gox @LIBGO_IS_LINUX_FALSE@exp_inotify_gox = @@ -714,10 +707,6 @@ toolexeclibgoexpsqldir = $(toolexeclibgoexpdir)/sql toolexeclibgoexpsql_DATA = \ exp/sql/driver.gox -toolexeclibgoexptemplatedir = $(toolexeclibgoexpdir)/template -toolexeclibgoexptemplate_DATA = \ - exp/template/html.gox - toolexeclibgogodir = $(toolexeclibgodir)/go toolexeclibgogo_DATA = \ go/ast.gox \ @@ -735,12 +724,9 @@ toolexeclibgohash_DATA = \ hash/crc64.gox \ hash/fnv.gox -toolexeclibgohttpdir = $(toolexeclibgodir)/http -toolexeclibgohttp_DATA = \ - http/cgi.gox \ - http/fcgi.gox \ - http/httptest.gox \ - http/pprof.gox +toolexeclibgohtmldir = $(toolexeclibgodir)/html +toolexeclibgohtml_DATA = \ + html/template.gox toolexeclibgoimagedir = $(toolexeclibgodir)/image toolexeclibgoimage_DATA = \ @@ -761,6 +747,16 @@ toolexeclibgoiodir = $(toolexeclibgodir)/io toolexeclibgoio_DATA = \ io/ioutil.gox +toolexeclibgologdir = $(toolexeclibgodir)/log +toolexeclibgolog_DATA = \ + log/syslog.gox + +toolexeclibgomathdir = $(toolexeclibgodir)/math +toolexeclibgomath_DATA = \ + math/big.gox \ + math/cmplx.gox \ + math/rand.gox + toolexeclibgomimedir = $(toolexeclibgodir)/mime toolexeclibgomime_DATA = \ mime/multipart.gox @@ -768,7 +764,24 @@ toolexeclibgomime_DATA = \ toolexeclibgonetdir = $(toolexeclibgodir)/net toolexeclibgonet_DATA = \ net/dict.gox \ - net/textproto.gox + net/http.gox \ + net/mail.gox \ + net/rpc.gox \ + net/smtp.gox \ + net/textproto.gox \ + net/url.gox + +toolexeclibgonethttpdir = $(toolexeclibgonetdir)/http +toolexeclibgonethttp_DATA = \ + net/http/cgi.gox \ + net/http/fcgi.gox \ + net/http/httptest.gox \ + net/http/httputil.gox \ + net/http/pprof.gox + +toolexeclibgonetrpcdir = $(toolexeclibgonetdir)/rpc +toolexeclibgonetrpc_DATA = \ + net/rpc/jsonrpc.gox toolexeclibgoolddir = $(toolexeclibgodir)/old toolexeclibgoold_DATA = \ @@ -778,6 +791,7 @@ toolexeclibgoold_DATA = \ toolexeclibgoosdir = $(toolexeclibgodir)/os toolexeclibgoos_DATA = \ + os/exec.gox \ os/user.gox \ os/signal.gox @@ -789,19 +803,11 @@ toolexeclibgoregexpdir = $(toolexeclibgodir)/regexp toolexeclibgoregexp_DATA = \ regexp/syntax.gox -toolexeclibgorpcdir = $(toolexeclibgodir)/rpc -toolexeclibgorpc_DATA = \ - rpc/jsonrpc.gox - toolexeclibgoruntimedir = $(toolexeclibgodir)/runtime toolexeclibgoruntime_DATA = \ runtime/debug.gox \ runtime/pprof.gox -toolexeclibgotemplatedir = $(toolexeclibgodir)/template -toolexeclibgotemplate_DATA = \ - template/parse.gox - toolexeclibgosyncdir = $(toolexeclibgodir)/sync toolexeclibgosync_DATA = \ sync/atomic.gox @@ -812,6 +818,21 @@ toolexeclibgotesting_DATA = \ testing/quick.gox \ testing/script.gox +toolexeclibgotextdir = $(toolexeclibgodir)/text +toolexeclibgotext_DATA = \ + text/scanner.gox \ + text/tabwriter.gox \ + text/template.gox + +toolexeclibgotexttemplatedir = $(toolexeclibgotextdir)/template +toolexeclibgotexttemplate_DATA = \ + text/template/parse.gox + +toolexeclibgounicodedir = $(toolexeclibgodir)/unicode +toolexeclibgounicode_DATA = \ + unicode/utf16.gox \ + unicode/utf8.gox + @HAVE_SYS_MMAN_H_FALSE@runtime_mem_file = runtime/mem_posix_memalign.c @HAVE_SYS_MMAN_H_TRUE@runtime_mem_file = runtime/mem.c @LIBGO_IS_RTEMS_FALSE@rtems_task_variable_add_file = @@ -901,18 +922,8 @@ runtime_files = \ runtime1.c \ sema.c \ sigqueue.c \ - string.c - -go_asn1_files = \ - go/asn1/asn1.go \ - go/asn1/common.go \ - go/asn1/marshal.go - -go_big_files = \ - go/big/arith.go \ - go/big/int.go \ - go/big/nat.go \ - go/big/rat.go + string.c \ + time.c go_bufio_files = \ go/bufio/bufio.go @@ -925,36 +936,12 @@ go_bytes_files = \ go_bytes_c_files = \ go/bytes/indexbyte.c -go_cmath_files = \ - go/cmath/abs.go \ - go/cmath/asin.go \ - go/cmath/conj.go \ - go/cmath/exp.go \ - go/cmath/isinf.go \ - go/cmath/isnan.go \ - go/cmath/log.go \ - go/cmath/phase.go \ - go/cmath/polar.go \ - go/cmath/pow.go \ - go/cmath/rect.go \ - go/cmath/sin.go \ - go/cmath/sqrt.go \ - go/cmath/tan.go - go_crypto_files = \ go/crypto/crypto.go -go_csv_files = \ - go/csv/reader.go \ - go/csv/writer.go - go_errors_files = \ go/errors/errors.go -go_exec_files = \ - go/exec/exec.go \ - go/exec/lp_unix.go - go_expvar_files = \ go/expvar/expvar.go @@ -967,15 +954,6 @@ go_fmt_files = \ go/fmt/print.go \ go/fmt/scan.go -go_gob_files = \ - go/gob/decode.go \ - go/gob/decoder.go \ - go/gob/doc.go \ - go/gob/encode.go \ - go/gob/encoder.go \ - go/gob/error.go \ - go/gob/type.go - go_hash_files = \ go/hash/hash.go @@ -989,25 +967,6 @@ go_html_files = \ go/html/render.go \ go/html/token.go -go_http_files = \ - go/http/chunked.go \ - go/http/client.go \ - go/http/cookie.go \ - go/http/dump.go \ - go/http/filetransport.go \ - go/http/fs.go \ - go/http/header.go \ - go/http/lex.go \ - go/http/persist.go \ - go/http/request.go \ - go/http/response.go \ - go/http/reverseproxy.go \ - go/http/server.go \ - go/http/sniff.go \ - go/http/status.go \ - go/http/transfer.go \ - go/http/transport.go - go_image_files = \ go/image/format.go \ go/image/geom.go \ @@ -1019,14 +978,6 @@ go_io_files = \ go/io/io.go \ go/io/pipe.go -go_json_files = \ - go/json/decode.go \ - go/json/encode.go \ - go/json/indent.go \ - go/json/scanner.go \ - go/json/stream.go \ - go/json/tags.go - go_log_files = \ go/log/log.go @@ -1078,9 +1029,6 @@ go_math_files = \ go/math/tanh.go \ go/math/unsafe.go -go_mail_files = \ - go/mail/message.go - go_mime_files = \ go/mime/grammar.go \ go/mime/mediatype.go \ @@ -1185,13 +1133,6 @@ go_path_files = \ go/path/match.go \ go/path/path.go -go_rand_files = \ - go/rand/exp.go \ - go/rand/normal.go \ - go/rand/rand.go \ - go/rand/rng.go \ - go/rand/zipf.go - go_reflect_files = \ go/reflect/deepequal.go \ go/reflect/type.go \ @@ -1201,10 +1142,10 @@ go_regexp_files = \ go/regexp/exec.go \ go/regexp/regexp.go -go_rpc_files = \ - go/rpc/client.go \ - go/rpc/debug.go \ - go/rpc/server.go +go_net_rpc_files = \ + go/net/rpc/client.go \ + go/net/rpc/debug.go \ + go/net/rpc/server.go go_runtime_files = \ go/runtime/debug.go \ @@ -1216,13 +1157,6 @@ go_runtime_files = \ go/runtime/type.go \ version.go -go_scanner_files = \ - go/scanner/scanner.go - -go_smtp_files = \ - go/smtp/auth.go \ - go/smtp/smtp.go - go_sort_files = \ go/sort/search.go \ go/sort/sort.go @@ -1248,26 +1182,15 @@ go_sync_files = \ go/sync/rwmutex.go \ go/sync/waitgroup.go -@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_SOLARIS_FALSE@go_syslog_file = go/syslog/syslog_unix.go -@LIBGO_IS_IRIX_TRUE@@LIBGO_IS_SOLARIS_FALSE@go_syslog_file = go/syslog/syslog_libc.go -@LIBGO_IS_SOLARIS_TRUE@go_syslog_file = go/syslog/syslog_libc.go -go_syslog_files = \ - go/syslog/syslog.go \ +@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_SOLARIS_FALSE@go_syslog_file = go/log/syslog/syslog_unix.go +@LIBGO_IS_IRIX_TRUE@@LIBGO_IS_SOLARIS_FALSE@go_syslog_file = go/log/syslog/syslog_libc.go +@LIBGO_IS_SOLARIS_TRUE@go_syslog_file = go/log/syslog/syslog_libc.go +go_log_syslog_files = \ + go/log/syslog/syslog.go \ $(go_syslog_file) go_syslog_c_files = \ - go/syslog/syslog_c.c - -go_tabwriter_files = \ - go/tabwriter/tabwriter.go - -go_template_files = \ - go/template/doc.go \ - go/template/exec.go \ - go/template/funcs.go \ - go/template/helper.go \ - go/template/parse.go \ - go/template/set.go + go/log/syslog/syslog_c.c go_testing_files = \ go/testing/benchmark.go \ @@ -1291,16 +1214,6 @@ go_unicode_files = \ go/unicode/letter.go \ go/unicode/tables.go -go_url_files = \ - go/url/url.go - -go_utf16_files = \ - go/utf16/utf16.go - -go_utf8_files = \ - go/utf8/string.go \ - go/utf8/utf8.go - go_websocket_files = \ go/websocket/client.go \ go/websocket/hixie.go \ @@ -1308,11 +1221,6 @@ go_websocket_files = \ go/websocket/server.go \ go/websocket/websocket.go -go_xml_files = \ - go/xml/marshal.go \ - go/xml/read.go \ - go/xml/xml.go - go_archive_tar_files = \ go/archive/tar/common.go \ go/archive/tar/reader.go \ @@ -1533,6 +1441,11 @@ go_debug_pe_files = \ go_encoding_ascii85_files = \ go/encoding/ascii85/ascii85.go +go_encoding_asn1_files = \ + go/encoding/asn1/asn1.go \ + go/encoding/asn1/common.go \ + go/encoding/asn1/marshal.go + go_encoding_base32_files = \ go/encoding/base32/base32.go @@ -1543,15 +1456,41 @@ go_encoding_binary_files = \ go/encoding/binary/binary.go \ go/encoding/binary/varint.go +go_encoding_csv_files = \ + go/encoding/csv/reader.go \ + go/encoding/csv/writer.go + go_encoding_git85_files = \ go/encoding/git85/git.go +go_encoding_gob_files = \ + go/encoding/gob/decode.go \ + go/encoding/gob/decoder.go \ + go/encoding/gob/doc.go \ + go/encoding/gob/encode.go \ + go/encoding/gob/encoder.go \ + go/encoding/gob/error.go \ + go/encoding/gob/type.go + go_encoding_hex_files = \ go/encoding/hex/hex.go +go_encoding_json_files = \ + go/encoding/json/decode.go \ + go/encoding/json/encode.go \ + go/encoding/json/indent.go \ + go/encoding/json/scanner.go \ + go/encoding/json/stream.go \ + go/encoding/json/tags.go + go_encoding_pem_files = \ go/encoding/pem/pem.go +go_encoding_xml_files = \ + go/encoding/xml/marshal.go \ + go/encoding/xml/read.go \ + go/encoding/xml/xml.go + go_exp_ebnf_files = \ go/exp/ebnf/ebnf.go \ go/exp/ebnf/parser.go @@ -1583,6 +1522,7 @@ go_exp_sql_files = \ go_exp_ssh_files = \ go/exp/ssh/channel.go \ go/exp/ssh/client.go \ + go/exp/ssh/client_auth.go \ go/exp/ssh/common.go \ go/exp/ssh/doc.go \ go/exp/ssh/messages.go \ @@ -1611,23 +1551,10 @@ go_exp_sql_driver_files = \ go/exp/sql/driver/driver.go \ go/exp/sql/driver/types.go -go_exp_template_html_files = \ - go/exp/template/html/attr.go \ - go/exp/template/html/clone.go \ - go/exp/template/html/content.go \ - go/exp/template/html/context.go \ - go/exp/template/html/css.go \ - go/exp/template/html/doc.go \ - go/exp/template/html/error.go \ - go/exp/template/html/escape.go \ - go/exp/template/html/html.go \ - go/exp/template/html/js.go \ - go/exp/template/html/transition.go \ - go/exp/template/html/url.go - go_go_ast_files = \ go/go/ast/ast.go \ go/go/ast/filter.go \ + go/go/ast/import.go \ go/go/ast/print.go \ go/go/ast/resolve.go \ go/go/ast/scope.go \ @@ -1674,20 +1601,20 @@ go_hash_crc64_files = \ go_hash_fnv_files = \ go/hash/fnv/fnv.go -go_http_cgi_files = \ - go/http/cgi/child.go \ - go/http/cgi/host.go - -go_http_fcgi_files = \ - go/http/fcgi/child.go \ - go/http/fcgi/fcgi.go - -go_http_httptest_files = \ - go/http/httptest/recorder.go \ - go/http/httptest/server.go - -go_http_pprof_files = \ - go/http/pprof/pprof.go +go_html_template_files = \ + go/html/template/attr.go \ + go/html/template/clone.go \ + go/html/template/content.go \ + go/html/template/context.go \ + go/html/template/css.go \ + go/html/template/doc.go \ + go/html/template/error.go \ + go/html/template/escape.go \ + go/html/template/html.go \ + go/html/template/js.go \ + go/html/template/template.go \ + go/html/template/transition.go \ + go/html/template/url.go go_image_bmp_files = \ go/image/bmp/reader.go @@ -1729,6 +1656,35 @@ go_io_ioutil_files = \ go/io/ioutil/ioutil.go \ go/io/ioutil/tempfile.go +go_math_big_files = \ + go/math/big/arith.go \ + go/math/big/int.go \ + go/math/big/nat.go \ + go/math/big/rat.go + +go_math_cmplx_files = \ + go/math/cmplx/abs.go \ + go/math/cmplx/asin.go \ + go/math/cmplx/conj.go \ + go/math/cmplx/exp.go \ + go/math/cmplx/isinf.go \ + go/math/cmplx/isnan.go \ + go/math/cmplx/log.go \ + go/math/cmplx/phase.go \ + go/math/cmplx/polar.go \ + go/math/cmplx/pow.go \ + go/math/cmplx/rect.go \ + go/math/cmplx/sin.go \ + go/math/cmplx/sqrt.go \ + go/math/cmplx/tan.go + +go_math_rand_files = \ + go/math/rand/exp.go \ + go/math/rand/normal.go \ + go/math/rand/rand.go \ + go/math/rand/rng.go \ + go/math/rand/zipf.go + go_mime_multipart_files = \ go/mime/multipart/formdata.go \ go/mime/multipart/multipart.go \ @@ -1737,6 +1693,29 @@ go_mime_multipart_files = \ go_net_dict_files = \ go/net/dict/dict.go +go_net_http_files = \ + go/net/http/chunked.go \ + go/net/http/client.go \ + go/net/http/cookie.go \ + go/net/http/filetransport.go \ + go/net/http/fs.go \ + go/net/http/header.go \ + go/net/http/lex.go \ + go/net/http/request.go \ + go/net/http/response.go \ + go/net/http/server.go \ + go/net/http/sniff.go \ + go/net/http/status.go \ + go/net/http/transfer.go \ + go/net/http/transport.go + +go_net_mail_files = \ + go/net/mail/message.go + +go_net_smtp_files = \ + go/net/smtp/auth.go \ + go/net/smtp/smtp.go + go_net_textproto_files = \ go/net/textproto/header.go \ go/net/textproto/pipeline.go \ @@ -1744,6 +1723,30 @@ go_net_textproto_files = \ go/net/textproto/textproto.go \ go/net/textproto/writer.go +go_net_url_files = \ + go/net/url/url.go + +go_net_http_cgi_files = \ + go/net/http/cgi/child.go \ + go/net/http/cgi/host.go + +go_net_http_fcgi_files = \ + go/net/http/fcgi/child.go \ + go/net/http/fcgi/fcgi.go + +go_net_http_httptest_files = \ + go/net/http/httptest/recorder.go \ + go/net/http/httptest/server.go + +go_net_http_pprof_files = \ + go/net/http/pprof/pprof.go + +go_net_http_httputil_files = \ + go/net/http/httputil/chunked.go \ + go/net/http/httputil/dump.go \ + go/net/http/httputil/persist.go \ + go/net/http/httputil/reverseproxy.go + go_old_netchan_files = \ go/old/netchan/common.go \ go/old/netchan/export.go \ @@ -1758,6 +1761,10 @@ go_old_template_files = \ go/old/template/format.go \ go/old/template/parse.go +go_os_exec_files = \ + go/os/exec/exec.go \ + go/os/exec/lp_unix.go + go_os_user_files = \ go/os/user/user.go \ go/os/user/lookup_unix.go @@ -1778,9 +1785,9 @@ go_regexp_syntax_files = \ go/regexp/syntax/regexp.go \ go/regexp/syntax/simplify.go -go_rpc_jsonrpc_files = \ - go/rpc/jsonrpc/client.go \ - go/rpc/jsonrpc/server.go +go_net_rpc_jsonrpc_files = \ + go/net/rpc/jsonrpc/client.go \ + go/net/rpc/jsonrpc/server.go go_runtime_debug_files = \ go/runtime/debug/stack.go @@ -1788,11 +1795,22 @@ go_runtime_debug_files = \ go_runtime_pprof_files = \ go/runtime/pprof/pprof.go -go_template_parse_files = \ - go/template/parse/lex.go \ - go/template/parse/node.go \ - go/template/parse/parse.go \ - go/template/parse/set.go +go_text_tabwriter_files = \ + go/text/tabwriter/tabwriter.go + +go_text_template_files = \ + go/text/template/doc.go \ + go/text/template/exec.go \ + go/text/template/funcs.go \ + go/text/template/helper.go \ + go/text/template/parse.go \ + go/text/template/set.go + +go_text_template_parse_files = \ + go/text/template/parse/lex.go \ + go/text/template/parse/node.go \ + go/text/template/parse/parse.go \ + go/text/template/parse/set.go go_sync_atomic_files = \ go/sync/atomic/doc.go @@ -1811,6 +1829,16 @@ go_testing_quick_files = \ go_testing_script_files = \ go/testing/script/script.go +go_text_scanner_files = \ + go/text/scanner/scanner.go + +go_unicode_utf16_files = \ + go/unicode/utf16/utf16.go + +go_unicode_utf8_files = \ + go/unicode/utf8/string.go \ + go/unicode/utf8/utf8.go + @LIBGO_IS_RTEMS_FALSE@syscall_syscall_file = go/syscall/syscall_unix.go # Define Syscall and Syscall6. @@ -1896,56 +1924,35 @@ go_syscall_c_files = \ # os_lib_inotify_lo = os/inotify.lo @LIBGO_IS_LINUX_TRUE@os_lib_inotify_lo = libgo_go_objs = \ - asn1/asn1.lo \ - big/big.lo \ bufio/bufio.lo \ bytes/bytes.lo \ bytes/index.lo \ - cmath/cmath.lo \ crypto/crypto.lo \ - csv/csv.lo \ errors/errors.lo \ - exec/exec.lo \ expvar/expvar.lo \ flag/flag.lo \ fmt/fmt.lo \ - gob/gob.lo \ hash/hash.lo \ html/html.lo \ - http/http.lo \ image/image.lo \ io/io.lo \ - json/json.lo \ log/log.lo \ math/math.lo \ - mail/mail.lo \ - mime/mime.lo \ net/net.lo \ + os/exec.lo \ os/os.lo \ patch/patch.lo \ path/path.lo \ - rand/rand.lo \ reflect/reflect.lo \ regexp/regexp.lo \ - rpc/rpc.lo \ runtime/runtime.lo \ - scanner/scanner.lo \ - smtp/smtp.lo \ sort/sort.lo \ strconv/strconv.lo \ strings/strings.lo \ sync/sync.lo \ - syslog/syslog.lo \ - syslog/syslog_c.lo \ - tabwriter/tabwriter.lo \ - template/template.lo \ time/time.lo \ unicode/unicode.lo \ - url/url.lo \ - utf16/utf16.lo \ - utf8/utf8.lo \ websocket/websocket.lo \ - xml/xml.lo \ archive/tar.lo \ archive/zip.lo \ compress/bzip2.lo \ @@ -1994,12 +2001,17 @@ libgo_go_objs = \ debug/macho.lo \ debug/pe.lo \ encoding/ascii85.lo \ + encoding/asn1.lo \ encoding/base32.lo \ encoding/base64.lo \ encoding/binary.lo \ + encoding/csv.lo \ encoding/git85.lo \ + encoding/gob.lo \ encoding/hex.lo \ + encoding/json.lo \ encoding/pem.lo \ + encoding/xml.lo \ exp/ebnf.lo \ exp/gui.lo \ exp/norm.lo \ @@ -2010,7 +2022,7 @@ libgo_go_objs = \ exp/types.lo \ exp/gui/x11.lo \ exp/sql/driver.lo \ - exp/template/html.lo \ + html/template.lo \ go/ast.lo \ go/build.lo \ go/doc.lo \ @@ -2022,10 +2034,11 @@ libgo_go_objs = \ hash/crc32.lo \ hash/crc64.lo \ hash/fnv.lo \ - http/cgi.lo \ - http/fcgi.lo \ - http/httptest.lo \ - http/pprof.lo \ + net/http/cgi.lo \ + net/http/fcgi.lo \ + net/http/httptest.lo \ + net/http/httputil.lo \ + net/http/pprof.lo \ image/bmp.lo \ image/color.lo \ image/draw.lo \ @@ -2036,9 +2049,20 @@ libgo_go_objs = \ image/ycbcr.lo \ index/suffixarray.lo \ io/ioutil.lo \ + log/syslog.lo \ + log/syslog/syslog_c.lo \ + math/big.lo \ + math/cmplx.lo \ + math/rand.lo \ + mime/mime.lo \ mime/multipart.lo \ net/dict.lo \ + net/http.lo \ + net/mail.lo \ + net/rpc.lo \ + net/smtp.lo \ net/textproto.lo \ + net/url.lo \ old/netchan.lo \ old/regexp.lo \ old/template.lo \ @@ -2047,7 +2071,7 @@ libgo_go_objs = \ os/signal.lo \ path/filepath.lo \ regexp/syntax.lo \ - rpc/jsonrpc.lo \ + net/rpc/jsonrpc.lo \ runtime/debug.lo \ runtime/pprof.lo \ sync/atomic.lo \ @@ -2055,11 +2079,16 @@ libgo_go_objs = \ syscall/syscall.lo \ syscall/errno.lo \ syscall/wait.lo \ - template/parse.lo \ + text/scanner.lo \ + text/tabwriter.lo \ + text/template.lo \ + text/template/parse.lo \ testing/testing.lo \ testing/iotest.lo \ testing/quick.lo \ - testing/script.lo + testing/script.lo \ + unicode/utf16.lo \ + unicode/utf8.lo libgo_la_SOURCES = $(runtime_files) libgo_la_LDFLAGS = $(PTHREAD_CFLAGS) $(AM_LDFLAGS) @@ -2142,18 +2171,23 @@ CHECK_DEPS = libgo.la libgobegin.a \ $(toolexeclibgoexp_DATA) \ $(toolexeclibgogo_DATA) \ $(toolexeclibgohash_DATA) \ - $(toolexeclibgohttp_DATA) \ $(toolexeclibgoimage_DATA) \ $(toolexeclibgoindex_DATA) \ $(toolexeclibgoio_DATA) \ + $(toolexeclibgolog_DATA) \ + $(toolexeclibgomath_DATA) \ $(toolexeclibgomime_DATA) \ $(toolexeclibgonet_DATA) \ + $(toolexeclibgonethttp_DATA) \ $(toolexeclibgoos_DATA) \ $(toolexeclibgopath_DATA) \ $(toolexeclibgorpc_DATA) \ $(toolexeclibgoruntime_DATA) \ $(toolexeclibgosync_DATA) \ - $(toolexeclibgotesting_DATA) + $(toolexeclibgotesting_DATA) \ + $(toolexeclibgotext_DATA) \ + $(toolexeclibgotexttemplate_DATA) \ + $(toolexeclibgounicode_DATA) # How to build a .gox file from a .lo file. @@ -2166,52 +2200,32 @@ BUILDGOX = \ # exp_inotify_check = exp/inotify/check @LIBGO_IS_LINUX_TRUE@exp_inotify_check = TEST_PACKAGES = \ - asn1/check \ - big/check \ bufio/check \ bytes/check \ - cmath/check \ - csv/check \ errors/check \ - exec/check \ expvar/check \ flag/check \ fmt/check \ - gob/check \ html/check \ - http/check \ image/check \ io/check \ - json/check \ log/check \ math/check \ - mail/check \ mime/check \ net/check \ os/check \ patch/check \ path/check \ - rand/check \ reflect/check \ regexp/check \ - rpc/check \ runtime/check \ - scanner/check \ - smtp/check \ sort/check \ strconv/check \ strings/check \ sync/check \ - syslog/check \ - tabwriter/check \ - template/check \ time/check \ unicode/check \ - url/check \ - utf16/check \ - utf8/check \ websocket/check \ - xml/check \ archive/tar/check \ archive/zip/check \ compress/bzip2/check \ @@ -2257,12 +2271,17 @@ TEST_PACKAGES = \ debug/macho/check \ debug/pe/check \ encoding/ascii85/check \ + encoding/asn1/check \ encoding/base32/check \ encoding/base64/check \ encoding/binary/check \ + encoding/csv/check \ encoding/git85/check \ + encoding/gob/check \ encoding/hex/check \ + encoding/json/check \ encoding/pem/check \ + encoding/xml/check \ exp/ebnf/check \ $(exp_inotify_check) \ exp/norm/check \ @@ -2270,7 +2289,7 @@ TEST_PACKAGES = \ exp/sql/check \ exp/ssh/check \ exp/terminal/check \ - exp/template/html/check \ + html/template/check \ go/ast/check \ $(go_build_check_omitted_since_it_calls_6g) \ go/parser/check \ @@ -2282,8 +2301,6 @@ TEST_PACKAGES = \ hash/crc32/check \ hash/crc64/check \ hash/fnv/check \ - http/cgi/check \ - http/fcgi/check \ image/draw/check \ image/jpeg/check \ image/png/check \ @@ -2291,20 +2308,38 @@ TEST_PACKAGES = \ image/ycbcr/check \ index/suffixarray/check \ io/ioutil/check \ + log/syslog/check \ + math/big/check \ + math/cmplx/check \ + math/rand/check \ mime/multipart/check \ + net/http/check \ + net/http/cgi/check \ + net/http/fcgi/check \ + net/http/httputil/check \ + net/mail/check \ + net/rpc/check \ + net/smtp/check \ net/textproto/check \ + net/url/check \ + net/rpc/jsonrpc/check \ old/netchan/check \ old/regexp/check \ old/template/check \ + os/exec/check \ os/user/check \ os/signal/check \ path/filepath/check \ regexp/syntax/check \ - rpc/jsonrpc/check \ sync/atomic/check \ - template/parse/check \ + text/scanner/check \ + text/tabwriter/check \ + text/template/check \ + text/template/parse/check \ testing/quick/check \ - testing/script/check + testing/script/check \ + unicode/utf16/check \ + unicode/utf8/check MOSTLYCLEAN_FILES = libgo.head libgo.sum.sep libgo.log.sep CLEANFILES = *.go *.gox goc2c *.c s-version libgo.sum libgo.log @@ -2527,6 +2562,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread-linux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread-sema.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thread.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yield.Plo@am__quote@ .c.o: @@ -3375,26 +3411,6 @@ uninstall-toolexeclibgoexpsqlDATA: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(toolexeclibgoexpsqldir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(toolexeclibgoexpsqldir)" && rm -f $$files -install-toolexeclibgoexptemplateDATA: $(toolexeclibgoexptemplate_DATA) - @$(NORMAL_INSTALL) - test -z "$(toolexeclibgoexptemplatedir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgoexptemplatedir)" - @list='$(toolexeclibgoexptemplate_DATA)'; test -n "$(toolexeclibgoexptemplatedir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgoexptemplatedir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgoexptemplatedir)" || exit $$?; \ - done - -uninstall-toolexeclibgoexptemplateDATA: - @$(NORMAL_UNINSTALL) - @list='$(toolexeclibgoexptemplate_DATA)'; test -n "$(toolexeclibgoexptemplatedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(toolexeclibgoexptemplatedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(toolexeclibgoexptemplatedir)" && rm -f $$files install-toolexeclibgogoDATA: $(toolexeclibgogo_DATA) @$(NORMAL_INSTALL) test -z "$(toolexeclibgogodir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgogodir)" @@ -3435,26 +3451,26 @@ uninstall-toolexeclibgohashDATA: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(toolexeclibgohashdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(toolexeclibgohashdir)" && rm -f $$files -install-toolexeclibgohttpDATA: $(toolexeclibgohttp_DATA) +install-toolexeclibgohtmlDATA: $(toolexeclibgohtml_DATA) @$(NORMAL_INSTALL) - test -z "$(toolexeclibgohttpdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgohttpdir)" - @list='$(toolexeclibgohttp_DATA)'; test -n "$(toolexeclibgohttpdir)" || list=; \ + test -z "$(toolexeclibgohtmldir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgohtmldir)" + @list='$(toolexeclibgohtml_DATA)'; test -n "$(toolexeclibgohtmldir)" || list=; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgohttpdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgohttpdir)" || exit $$?; \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgohtmldir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgohtmldir)" || exit $$?; \ done -uninstall-toolexeclibgohttpDATA: +uninstall-toolexeclibgohtmlDATA: @$(NORMAL_UNINSTALL) - @list='$(toolexeclibgohttp_DATA)'; test -n "$(toolexeclibgohttpdir)" || list=; \ + @list='$(toolexeclibgohtml_DATA)'; test -n "$(toolexeclibgohtmldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(toolexeclibgohttpdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(toolexeclibgohttpdir)" && rm -f $$files + echo " ( cd '$(DESTDIR)$(toolexeclibgohtmldir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibgohtmldir)" && rm -f $$files install-toolexeclibgoimageDATA: $(toolexeclibgoimage_DATA) @$(NORMAL_INSTALL) test -z "$(toolexeclibgoimagedir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgoimagedir)" @@ -3515,6 +3531,46 @@ uninstall-toolexeclibgoioDATA: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(toolexeclibgoiodir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(toolexeclibgoiodir)" && rm -f $$files +install-toolexeclibgologDATA: $(toolexeclibgolog_DATA) + @$(NORMAL_INSTALL) + test -z "$(toolexeclibgologdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgologdir)" + @list='$(toolexeclibgolog_DATA)'; test -n "$(toolexeclibgologdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgologdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgologdir)" || exit $$?; \ + done + +uninstall-toolexeclibgologDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclibgolog_DATA)'; test -n "$(toolexeclibgologdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(toolexeclibgologdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibgologdir)" && rm -f $$files +install-toolexeclibgomathDATA: $(toolexeclibgomath_DATA) + @$(NORMAL_INSTALL) + test -z "$(toolexeclibgomathdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgomathdir)" + @list='$(toolexeclibgomath_DATA)'; test -n "$(toolexeclibgomathdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgomathdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgomathdir)" || exit $$?; \ + done + +uninstall-toolexeclibgomathDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclibgomath_DATA)'; test -n "$(toolexeclibgomathdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(toolexeclibgomathdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibgomathdir)" && rm -f $$files install-toolexeclibgomimeDATA: $(toolexeclibgomime_DATA) @$(NORMAL_INSTALL) test -z "$(toolexeclibgomimedir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgomimedir)" @@ -3555,6 +3611,46 @@ uninstall-toolexeclibgonetDATA: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(toolexeclibgonetdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(toolexeclibgonetdir)" && rm -f $$files +install-toolexeclibgonethttpDATA: $(toolexeclibgonethttp_DATA) + @$(NORMAL_INSTALL) + test -z "$(toolexeclibgonethttpdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgonethttpdir)" + @list='$(toolexeclibgonethttp_DATA)'; test -n "$(toolexeclibgonethttpdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgonethttpdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgonethttpdir)" || exit $$?; \ + done + +uninstall-toolexeclibgonethttpDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclibgonethttp_DATA)'; test -n "$(toolexeclibgonethttpdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(toolexeclibgonethttpdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibgonethttpdir)" && rm -f $$files +install-toolexeclibgonetrpcDATA: $(toolexeclibgonetrpc_DATA) + @$(NORMAL_INSTALL) + test -z "$(toolexeclibgonetrpcdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgonetrpcdir)" + @list='$(toolexeclibgonetrpc_DATA)'; test -n "$(toolexeclibgonetrpcdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgonetrpcdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgonetrpcdir)" || exit $$?; \ + done + +uninstall-toolexeclibgonetrpcDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclibgonetrpc_DATA)'; test -n "$(toolexeclibgonetrpcdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(toolexeclibgonetrpcdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibgonetrpcdir)" && rm -f $$files install-toolexeclibgooldDATA: $(toolexeclibgoold_DATA) @$(NORMAL_INSTALL) test -z "$(toolexeclibgoolddir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgoolddir)" @@ -3635,26 +3731,6 @@ uninstall-toolexeclibgoregexpDATA: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(toolexeclibgoregexpdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(toolexeclibgoregexpdir)" && rm -f $$files -install-toolexeclibgorpcDATA: $(toolexeclibgorpc_DATA) - @$(NORMAL_INSTALL) - test -z "$(toolexeclibgorpcdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgorpcdir)" - @list='$(toolexeclibgorpc_DATA)'; test -n "$(toolexeclibgorpcdir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgorpcdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgorpcdir)" || exit $$?; \ - done - -uninstall-toolexeclibgorpcDATA: - @$(NORMAL_UNINSTALL) - @list='$(toolexeclibgorpc_DATA)'; test -n "$(toolexeclibgorpcdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(toolexeclibgorpcdir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(toolexeclibgorpcdir)" && rm -f $$files install-toolexeclibgoruntimeDATA: $(toolexeclibgoruntime_DATA) @$(NORMAL_INSTALL) test -z "$(toolexeclibgoruntimedir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgoruntimedir)" @@ -3695,26 +3771,6 @@ uninstall-toolexeclibgosyncDATA: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(toolexeclibgosyncdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(toolexeclibgosyncdir)" && rm -f $$files -install-toolexeclibgotemplateDATA: $(toolexeclibgotemplate_DATA) - @$(NORMAL_INSTALL) - test -z "$(toolexeclibgotemplatedir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgotemplatedir)" - @list='$(toolexeclibgotemplate_DATA)'; test -n "$(toolexeclibgotemplatedir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgotemplatedir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgotemplatedir)" || exit $$?; \ - done - -uninstall-toolexeclibgotemplateDATA: - @$(NORMAL_UNINSTALL) - @list='$(toolexeclibgotemplate_DATA)'; test -n "$(toolexeclibgotemplatedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(toolexeclibgotemplatedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(toolexeclibgotemplatedir)" && rm -f $$files install-toolexeclibgotestingDATA: $(toolexeclibgotesting_DATA) @$(NORMAL_INSTALL) test -z "$(toolexeclibgotestingdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgotestingdir)" @@ -3735,6 +3791,66 @@ uninstall-toolexeclibgotestingDATA: test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(toolexeclibgotestingdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(toolexeclibgotestingdir)" && rm -f $$files +install-toolexeclibgotextDATA: $(toolexeclibgotext_DATA) + @$(NORMAL_INSTALL) + test -z "$(toolexeclibgotextdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgotextdir)" + @list='$(toolexeclibgotext_DATA)'; test -n "$(toolexeclibgotextdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgotextdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgotextdir)" || exit $$?; \ + done + +uninstall-toolexeclibgotextDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclibgotext_DATA)'; test -n "$(toolexeclibgotextdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(toolexeclibgotextdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibgotextdir)" && rm -f $$files +install-toolexeclibgotexttemplateDATA: $(toolexeclibgotexttemplate_DATA) + @$(NORMAL_INSTALL) + test -z "$(toolexeclibgotexttemplatedir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgotexttemplatedir)" + @list='$(toolexeclibgotexttemplate_DATA)'; test -n "$(toolexeclibgotexttemplatedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgotexttemplatedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgotexttemplatedir)" || exit $$?; \ + done + +uninstall-toolexeclibgotexttemplateDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclibgotexttemplate_DATA)'; test -n "$(toolexeclibgotexttemplatedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(toolexeclibgotexttemplatedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibgotexttemplatedir)" && rm -f $$files +install-toolexeclibgounicodeDATA: $(toolexeclibgounicode_DATA) + @$(NORMAL_INSTALL) + test -z "$(toolexeclibgounicodedir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibgounicodedir)" + @list='$(toolexeclibgounicode_DATA)'; test -n "$(toolexeclibgounicodedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(toolexeclibgounicodedir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(toolexeclibgounicodedir)" || exit $$?; \ + done + +uninstall-toolexeclibgounicodeDATA: + @$(NORMAL_UNINSTALL) + @list='$(toolexeclibgounicode_DATA)'; test -n "$(toolexeclibgounicodedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(toolexeclibgounicodedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(toolexeclibgounicodedir)" && rm -f $$files # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -4052,7 +4168,7 @@ all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) all-multi $(DATA) \ config.h installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibgodir)" "$(DESTDIR)$(toolexeclibgoarchivedir)" "$(DESTDIR)$(toolexeclibgocompressdir)" "$(DESTDIR)$(toolexeclibgocontainerdir)" "$(DESTDIR)$(toolexeclibgocryptodir)" "$(DESTDIR)$(toolexeclibgocryptoopenpgpdir)" "$(DESTDIR)$(toolexeclibgocryptox509dir)" "$(DESTDIR)$(toolexeclibgodebugdir)" "$(DESTDIR)$(toolexeclibgoencodingdir)" "$(DESTDIR)$(toolexeclibgoexpdir)" "$(DESTDIR)$(toolexeclibgoexpguidir)" "$(DESTDIR)$(toolexeclibgoexpsqldir)" "$(DESTDIR)$(toolexeclibgoexptemplatedir)" "$(DESTDIR)$(toolexeclibgogodir)" "$(DESTDIR)$(toolexeclibgohashdir)" "$(DESTDIR)$(toolexeclibgohttpdir)" "$(DESTDIR)$(toolexeclibgoimagedir)" "$(DESTDIR)$(toolexeclibgoindexdir)" "$(DESTDIR)$(toolexeclibgoiodir)" "$(DESTDIR)$(toolexeclibgomimedir)" "$(DESTDIR)$(toolexeclibgonetdir)" "$(DESTDIR)$(toolexeclibgoolddir)" "$(DESTDIR)$(toolexeclibgoosdir)" "$(DESTDIR)$(toolexeclibgopathdir)" "$(DESTDIR)$(toolexeclibgoregexpdir)" "$(DESTDIR)$(toolexeclibgorpcdir)" "$(DESTDIR)$(toolexeclibgoruntimedir)" "$(DESTDIR)$(toolexeclibgosyncdir)" "$(DESTDIR)$(toolexeclibgotemplatedir)" "$(DESTDIR)$(toolexeclibgotestingdir)"; do \ + for dir in "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibdir)" "$(DESTDIR)$(toolexeclibgodir)" "$(DESTDIR)$(toolexeclibgoarchivedir)" "$(DESTDIR)$(toolexeclibgocompressdir)" "$(DESTDIR)$(toolexeclibgocontainerdir)" "$(DESTDIR)$(toolexeclibgocryptodir)" "$(DESTDIR)$(toolexeclibgocryptoopenpgpdir)" "$(DESTDIR)$(toolexeclibgocryptox509dir)" "$(DESTDIR)$(toolexeclibgodebugdir)" "$(DESTDIR)$(toolexeclibgoencodingdir)" "$(DESTDIR)$(toolexeclibgoexpdir)" "$(DESTDIR)$(toolexeclibgoexpguidir)" "$(DESTDIR)$(toolexeclibgoexpsqldir)" "$(DESTDIR)$(toolexeclibgogodir)" "$(DESTDIR)$(toolexeclibgohashdir)" "$(DESTDIR)$(toolexeclibgohtmldir)" "$(DESTDIR)$(toolexeclibgoimagedir)" "$(DESTDIR)$(toolexeclibgoindexdir)" "$(DESTDIR)$(toolexeclibgoiodir)" "$(DESTDIR)$(toolexeclibgologdir)" "$(DESTDIR)$(toolexeclibgomathdir)" "$(DESTDIR)$(toolexeclibgomimedir)" "$(DESTDIR)$(toolexeclibgonetdir)" "$(DESTDIR)$(toolexeclibgonethttpdir)" "$(DESTDIR)$(toolexeclibgonetrpcdir)" "$(DESTDIR)$(toolexeclibgoolddir)" "$(DESTDIR)$(toolexeclibgoosdir)" "$(DESTDIR)$(toolexeclibgopathdir)" "$(DESTDIR)$(toolexeclibgoregexpdir)" "$(DESTDIR)$(toolexeclibgoruntimedir)" "$(DESTDIR)$(toolexeclibgosyncdir)" "$(DESTDIR)$(toolexeclibgotestingdir)" "$(DESTDIR)$(toolexeclibgotextdir)" "$(DESTDIR)$(toolexeclibgotexttemplatedir)" "$(DESTDIR)$(toolexeclibgounicodedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive @@ -4123,18 +4239,19 @@ install-exec-am: install-multi install-toolexeclibLIBRARIES \ install-toolexeclibgodebugDATA \ install-toolexeclibgoencodingDATA install-toolexeclibgoexpDATA \ install-toolexeclibgoexpguiDATA \ - install-toolexeclibgoexpsqlDATA \ - install-toolexeclibgoexptemplateDATA \ - install-toolexeclibgogoDATA install-toolexeclibgohashDATA \ - install-toolexeclibgohttpDATA install-toolexeclibgoimageDATA \ - install-toolexeclibgoindexDATA install-toolexeclibgoioDATA \ - install-toolexeclibgomimeDATA install-toolexeclibgonetDATA \ - install-toolexeclibgooldDATA install-toolexeclibgoosDATA \ - install-toolexeclibgopathDATA install-toolexeclibgoregexpDATA \ - install-toolexeclibgorpcDATA install-toolexeclibgoruntimeDATA \ - install-toolexeclibgosyncDATA \ - install-toolexeclibgotemplateDATA \ - install-toolexeclibgotestingDATA + install-toolexeclibgoexpsqlDATA install-toolexeclibgogoDATA \ + install-toolexeclibgohashDATA install-toolexeclibgohtmlDATA \ + install-toolexeclibgoimageDATA install-toolexeclibgoindexDATA \ + install-toolexeclibgoioDATA install-toolexeclibgologDATA \ + install-toolexeclibgomathDATA install-toolexeclibgomimeDATA \ + install-toolexeclibgonetDATA install-toolexeclibgonethttpDATA \ + install-toolexeclibgonetrpcDATA install-toolexeclibgooldDATA \ + install-toolexeclibgoosDATA install-toolexeclibgopathDATA \ + install-toolexeclibgoregexpDATA \ + install-toolexeclibgoruntimeDATA install-toolexeclibgosyncDATA \ + install-toolexeclibgotestingDATA install-toolexeclibgotextDATA \ + install-toolexeclibgotexttemplateDATA \ + install-toolexeclibgounicodeDATA install-html: install-html-recursive @@ -4189,20 +4306,23 @@ uninstall-am: uninstall-toolexeclibLIBRARIES \ uninstall-toolexeclibgoexpDATA \ uninstall-toolexeclibgoexpguiDATA \ uninstall-toolexeclibgoexpsqlDATA \ - uninstall-toolexeclibgoexptemplateDATA \ uninstall-toolexeclibgogoDATA uninstall-toolexeclibgohashDATA \ - uninstall-toolexeclibgohttpDATA \ + uninstall-toolexeclibgohtmlDATA \ uninstall-toolexeclibgoimageDATA \ uninstall-toolexeclibgoindexDATA uninstall-toolexeclibgoioDATA \ + uninstall-toolexeclibgologDATA uninstall-toolexeclibgomathDATA \ uninstall-toolexeclibgomimeDATA uninstall-toolexeclibgonetDATA \ + uninstall-toolexeclibgonethttpDATA \ + uninstall-toolexeclibgonetrpcDATA \ uninstall-toolexeclibgooldDATA uninstall-toolexeclibgoosDATA \ uninstall-toolexeclibgopathDATA \ uninstall-toolexeclibgoregexpDATA \ - uninstall-toolexeclibgorpcDATA \ uninstall-toolexeclibgoruntimeDATA \ uninstall-toolexeclibgosyncDATA \ - uninstall-toolexeclibgotemplateDATA \ - uninstall-toolexeclibgotestingDATA + uninstall-toolexeclibgotestingDATA \ + uninstall-toolexeclibgotextDATA \ + uninstall-toolexeclibgotexttemplateDATA \ + uninstall-toolexeclibgounicodeDATA .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all all-multi \ clean-multi ctags-recursive distclean-multi install-am \ @@ -4233,18 +4353,19 @@ uninstall-am: uninstall-toolexeclibLIBRARIES \ install-toolexeclibgodebugDATA \ install-toolexeclibgoencodingDATA install-toolexeclibgoexpDATA \ install-toolexeclibgoexpguiDATA \ - install-toolexeclibgoexpsqlDATA \ - install-toolexeclibgoexptemplateDATA \ - install-toolexeclibgogoDATA install-toolexeclibgohashDATA \ - install-toolexeclibgohttpDATA install-toolexeclibgoimageDATA \ - install-toolexeclibgoindexDATA install-toolexeclibgoioDATA \ - install-toolexeclibgomimeDATA install-toolexeclibgonetDATA \ - install-toolexeclibgooldDATA install-toolexeclibgoosDATA \ - install-toolexeclibgopathDATA install-toolexeclibgoregexpDATA \ - install-toolexeclibgorpcDATA install-toolexeclibgoruntimeDATA \ - install-toolexeclibgosyncDATA \ - install-toolexeclibgotemplateDATA \ - install-toolexeclibgotestingDATA installcheck installcheck-am \ + install-toolexeclibgoexpsqlDATA install-toolexeclibgogoDATA \ + install-toolexeclibgohashDATA install-toolexeclibgohtmlDATA \ + install-toolexeclibgoimageDATA install-toolexeclibgoindexDATA \ + install-toolexeclibgoioDATA install-toolexeclibgologDATA \ + install-toolexeclibgomathDATA install-toolexeclibgomimeDATA \ + install-toolexeclibgonetDATA install-toolexeclibgonethttpDATA \ + install-toolexeclibgonetrpcDATA install-toolexeclibgooldDATA \ + install-toolexeclibgoosDATA install-toolexeclibgopathDATA \ + install-toolexeclibgoregexpDATA \ + install-toolexeclibgoruntimeDATA install-toolexeclibgosyncDATA \ + install-toolexeclibgotestingDATA install-toolexeclibgotextDATA \ + install-toolexeclibgotexttemplateDATA \ + install-toolexeclibgounicodeDATA installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic maintainer-clean-multi mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ @@ -4263,20 +4384,23 @@ uninstall-am: uninstall-toolexeclibLIBRARIES \ uninstall-toolexeclibgoexpDATA \ uninstall-toolexeclibgoexpguiDATA \ uninstall-toolexeclibgoexpsqlDATA \ - uninstall-toolexeclibgoexptemplateDATA \ uninstall-toolexeclibgogoDATA uninstall-toolexeclibgohashDATA \ - uninstall-toolexeclibgohttpDATA \ + uninstall-toolexeclibgohtmlDATA \ uninstall-toolexeclibgoimageDATA \ uninstall-toolexeclibgoindexDATA uninstall-toolexeclibgoioDATA \ + uninstall-toolexeclibgologDATA uninstall-toolexeclibgomathDATA \ uninstall-toolexeclibgomimeDATA uninstall-toolexeclibgonetDATA \ + uninstall-toolexeclibgonethttpDATA \ + uninstall-toolexeclibgonetrpcDATA \ uninstall-toolexeclibgooldDATA uninstall-toolexeclibgoosDATA \ uninstall-toolexeclibgopathDATA \ uninstall-toolexeclibgoregexpDATA \ - uninstall-toolexeclibgorpcDATA \ uninstall-toolexeclibgoruntimeDATA \ uninstall-toolexeclibgosyncDATA \ - uninstall-toolexeclibgotemplateDATA \ - uninstall-toolexeclibgotestingDATA + uninstall-toolexeclibgotestingDATA \ + uninstall-toolexeclibgotextDATA \ + uninstall-toolexeclibgotexttemplateDATA \ + uninstall-toolexeclibgounicodeDATA goc2c.$(OBJEXT): runtime/goc2c.c @@ -4309,6 +4433,10 @@ sigqueue.c: $(srcdir)/runtime/sigqueue.goc goc2c ./goc2c --gcc --go-prefix libgo_runtime $< > $@.tmp mv -f $@.tmp $@ +time.c: $(srcdir)/runtime/time.goc goc2c + ./goc2c --gcc --go-prefix libgo_time $< > $@.tmp + mv -f $@.tmp $@ + %.c: $(srcdir)/runtime/%.goc goc2c ./goc2c --gcc $< > $@.tmp mv -f $@.tmp $@ @@ -4375,24 +4503,6 @@ s-epoll: Makefile $(SHELL) $(srcdir)/../move-if-change epoll.go.tmp epoll.go $(STAMP) $@ -@go_include@ asn1/asn1.lo.dep -asn1/asn1.lo.dep: $(go_asn1_files) - $(BUILDDEPS) -asn1/asn1.lo: $(go_asn1_files) - $(BUILDPACKAGE) -asn1/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: asn1/check - -@go_include@ big/big.lo.dep -big/big.lo.dep: $(go_big_files) - $(BUILDDEPS) -big/big.lo: $(go_big_files) - $(BUILDPACKAGE) -big/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: big/check - @go_include@ bufio/bufio.lo.dep bufio/bufio.lo.dep: $(go_bufio_files) $(BUILDDEPS) @@ -4413,15 +4523,6 @@ bytes/check: $(CHECK_DEPS) @$(CHECK) .PHONY: bytes/check -@go_include@ cmath/cmath.lo.dep -cmath/cmath.lo.dep: $(go_cmath_files) - $(BUILDDEPS) -cmath/cmath.lo: $(go_cmath_files) - $(BUILDPACKAGE) -cmath/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: cmath/check - @go_include@ crypto/crypto.lo.dep crypto/crypto.lo.dep: $(go_crypto_files) $(BUILDDEPS) @@ -4431,15 +4532,6 @@ crypto/check: $(CHECK_DEPS) @$(CHECK) .PHONY: crypto/check -@go_include@ csv/csv.lo.dep -csv/csv.lo.dep: $(go_csv_files) - $(BUILDDEPS) -csv/csv.lo: $(go_csv_files) - $(BUILDPACKAGE) -csv/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: csv/check - @go_include@ errors/errors.lo.dep errors/errors.lo.dep: $(go_errors_files) $(BUILDDEPS) @@ -4449,15 +4541,6 @@ errors/check: $(CHECK_DEPS) @$(CHECK) .PHONY: errors/check -@go_include@ exec/exec.lo.dep -exec/exec.lo.dep: $(go_exec_files) - $(BUILDDEPS) -exec/exec.lo: $(go_exec_files) - $(BUILDPACKAGE) -exec/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: exec/check - @go_include@ expvar/expvar.lo.dep expvar/expvar.lo.dep: $(go_expvar_files) $(BUILDDEPS) @@ -4485,15 +4568,6 @@ fmt/check: $(CHECK_DEPS) @$(CHECK) .PHONY: fmt/check -@go_include@ gob/gob.lo.dep -gob/gob.lo.dep: $(go_gob_files) - $(BUILDDEPS) -gob/gob.lo: $(go_gob_files) - $(BUILDPACKAGE) -gob/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: gob/check - @go_include@ hash/hash.lo.dep hash/hash.lo.dep: $(go_hash_files) $(BUILDDEPS) @@ -4512,15 +4586,6 @@ html/check: $(CHECK_DEPS) @$(CHECK) .PHONY: html/check -@go_include@ http/http.lo.dep -http/http.lo.dep: $(go_http_files) - $(BUILDDEPS) -http/http.lo: $(go_http_files) - $(BUILDPACKAGE) -http/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: http/check - @go_include@ image/image.lo.dep image/image.lo.dep: $(go_image_files) $(BUILDDEPS) @@ -4539,15 +4604,6 @@ io/check: $(CHECK_DEPS) @$(CHECK) .PHONY: io/check -@go_include@ json/json.lo.dep -json/json.lo.dep: $(go_json_files) - $(BUILDDEPS) -json/json.lo: $(go_json_files) - $(BUILDPACKAGE) -json/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: json/check - @go_include@ log/log.lo.dep log/log.lo.dep: $(go_log_files) $(BUILDDEPS) @@ -4566,15 +4622,6 @@ math/check: $(CHECK_DEPS) @$(CHECK) .PHONY: math/check -@go_include@ mail/mail.lo.dep -mail/mail.lo.dep: $(go_mail_files) - $(BUILDDEPS) -mail/mail.lo: $(go_mail_files) - $(BUILDPACKAGE) -mail/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: mail/check - @go_include@ mime/mime.lo.dep mime/mime.lo.dep: $(go_mime_files) $(BUILDDEPS) @@ -4624,15 +4671,6 @@ path/check: $(CHECK_DEPS) @$(CHECK) .PHONY: path/check -@go_include@ rand/rand.lo.dep -rand/rand.lo.dep: $(go_rand_files) - $(BUILDDEPS) -rand/rand.lo: $(go_rand_files) - $(BUILDPACKAGE) -rand/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: rand/check - @go_include@ reflect/reflect.lo.dep reflect/reflect.lo.dep: $(go_reflect_files) $(BUILDDEPS) @@ -4651,15 +4689,6 @@ regexp/check: $(CHECK_DEPS) @$(CHECK) .PHONY: regexp/check -@go_include@ rpc/rpc.lo.dep -rpc/rpc.lo.dep: $(go_rpc_files) - $(BUILDDEPS) -rpc/rpc.lo: $(go_rpc_files) - $(BUILDPACKAGE) -rpc/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: rpc/check - @go_include@ runtime/runtime.lo.dep runtime/runtime.lo.dep: $(go_runtime_files) $(BUILDDEPS) @@ -4669,23 +4698,15 @@ runtime/check: $(CHECK_DEPS) @$(CHECK) .PHONY: runtime/check -@go_include@ scanner/scanner.lo.dep -scanner/scanner.lo.dep: $(go_scanner_files) +@go_include@ text/scanner.lo.dep +text/scanner.lo.dep: $(go_text_scanner_files) $(BUILDDEPS) -scanner/scanner.lo: $(go_scanner_files) +text/scanner.lo: $(go_text_scanner_files) $(BUILDPACKAGE) -scanner/check: $(CHECK_DEPS) +text/scanner/check: $(CHECK_DEPS) + @$(MKDIR_P) text/scanner @$(CHECK) -.PHONY: scanner/check - -@go_include@ smtp/smtp.lo.dep -smtp/smtp.lo.dep: $(go_smtp_files) - $(BUILDDEPS) -smtp/smtp.lo: $(go_smtp_files) - $(BUILDPACKAGE) -smtp/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: smtp/check +.PHONY: text/scanner/check @go_include@ sort/sort.lo.dep sort/sort.lo.dep: $(go_sort_files) @@ -4723,35 +4744,6 @@ sync/check: $(CHECK_DEPS) @$(CHECK) .PHONY: sync/check -@go_include@ syslog/syslog.lo.dep -syslog/syslog.lo.dep: $(go_syslog_files) - $(BUILDDEPS) -syslog/syslog.lo: $(go_syslog_files) - $(BUILDPACKAGE) -syslog/syslog_c.lo: $(go_syslog_c_files) syslog/syslog.lo - $(LTCOMPILE) -c -o $@ $(srcdir)/go/syslog/syslog_c.c -syslog/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: syslog/check - -@go_include@ tabwriter/tabwriter.lo.dep -tabwriter/tabwriter.lo.dep: $(go_tabwriter_files) - $(BUILDDEPS) -tabwriter/tabwriter.lo: $(go_tabwriter_files) - $(BUILDPACKAGE) -tabwriter/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: tabwriter/check - -@go_include@ template/template.lo.dep -template/template.lo.dep: $(go_template_files) - $(BUILDDEPS) -template/template.lo: $(go_template_files) - $(BUILDPACKAGE) -template/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: template/check - @go_include@ testing/testing.lo.dep testing/testing.lo.dep: $(go_testing_files) $(BUILDDEPS) @@ -4779,33 +4771,6 @@ unicode/check: $(CHECK_DEPS) @$(CHECK) .PHONY: unicode/check -@go_include@ url/url.lo.dep -url/url.lo.dep: $(go_url_files) - $(BUILDDEPS) -url/url.lo: $(go_url_files) - $(BUILDPACKAGE) -url/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: url/check - -@go_include@ utf16/utf16.lo.dep -utf16/utf16.lo.dep: $(go_utf16_files) - $(BUILDDEPS) -utf16/utf16.lo: $(go_utf16_files) - $(BUILDPACKAGE) -utf16/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: utf16/check - -@go_include@ utf8/utf8.lo.dep -utf8/utf8.lo.dep: $(go_utf8_files) - $(BUILDDEPS) -utf8/utf8.lo: $(go_utf8_files) - $(BUILDPACKAGE) -utf8/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: utf8/check - @go_include@ websocket/websocket.lo.dep websocket/websocket.lo.dep: $(go_websocket_files) $(BUILDDEPS) @@ -4815,15 +4780,6 @@ websocket/check: $(CHECK_DEPS) @$(CHECK) .PHONY: websocket/check -@go_include@ xml/xml.lo.dep -xml/xml.lo.dep: $(go_xml_files) - $(BUILDDEPS) -xml/xml.lo: $(go_xml_files) - $(BUILDPACKAGE) -xml/check: $(CHECK_DEPS) - @$(CHECK) -.PHONY: xml/check - @go_include@ archive/tar.lo.dep archive/tar.lo.dep: $(go_archive_tar_files) $(BUILDDEPS) @@ -5294,6 +5250,16 @@ debug/pe/check: $(CHECK_DEPS) @$(CHECK) .PHONY: debug/pe/check +@go_include@ encoding/asn1.lo.dep +encoding/asn1.lo.dep: $(go_encoding_asn1_files) + $(BUILDDEPS) +encoding/asn1.lo: $(go_encoding_asn1_files) + $(BUILDPACKAGE) +encoding/asn1/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/asn1 + @$(CHECK) +.PHONY: encoding/asn1/check + @go_include@ encoding/ascii85.lo.dep encoding/ascii85.lo.dep: $(go_encoding_ascii85_files) $(BUILDDEPS) @@ -5334,6 +5300,16 @@ encoding/binary/check: $(CHECK_DEPS) @$(CHECK) .PHONY: encoding/binary/check +@go_include@ encoding/csv.lo.dep +encoding/csv.lo.dep: $(go_encoding_csv_files) + $(BUILDDEPS) +encoding/csv.lo: $(go_encoding_csv_files) + $(BUILDPACKAGE) +encoding/csv/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/csv + @$(CHECK) +.PHONY: encoding/csv/check + @go_include@ encoding/git85.lo.dep encoding/git85.lo.dep: $(go_encoding_git85_files) $(BUILDDEPS) @@ -5344,6 +5320,16 @@ encoding/git85/check: $(CHECK_DEPS) @$(CHECK) .PHONY: encoding/git85/check +@go_include@ encoding/gob.lo.dep +encoding/gob.lo.dep: $(go_encoding_gob_files) + $(BUILDDEPS) +encoding/gob.lo: $(go_encoding_gob_files) + $(BUILDPACKAGE) +encoding/gob/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/gob + @$(CHECK) +.PHONY: encoding/gob/check + @go_include@ encoding/hex.lo.dep encoding/hex.lo.dep: $(go_encoding_hex_files) $(BUILDDEPS) @@ -5354,6 +5340,16 @@ encoding/hex/check: $(CHECK_DEPS) @$(CHECK) .PHONY: encoding/hex/check +@go_include@ encoding/json.lo.dep +encoding/json.lo.dep: $(go_encoding_json_files) + $(BUILDDEPS) +encoding/json.lo: $(go_encoding_json_files) + $(BUILDPACKAGE) +encoding/json/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/json + @$(CHECK) +.PHONY: encoding/json/check + @go_include@ encoding/pem.lo.dep encoding/pem.lo.dep: $(go_encoding_pem_files) $(BUILDDEPS) @@ -5364,6 +5360,16 @@ encoding/pem/check: $(CHECK_DEPS) @$(CHECK) .PHONY: encoding/pem/check +@go_include@ encoding/xml.lo.dep +encoding/xml.lo.dep: $(go_encoding_xml_files) + $(BUILDDEPS) +encoding/xml.lo: $(go_encoding_xml_files) + $(BUILDPACKAGE) +encoding/xml/check: $(CHECK_DEPS) + @$(MKDIR_P) encoding/xml + @$(CHECK) +.PHONY: encoding/xml/check + @go_include@ exp/ebnf.lo.dep exp/ebnf.lo.dep: $(go_exp_ebnf_files) $(BUILDDEPS) @@ -5474,15 +5480,15 @@ exp/sql/driver/check: $(CHECK_DEPS) @$(CHECK) .PHONY: exp/sql/driver/check -@go_include@ exp/template/html.lo.dep -exp/template/html.lo.dep: $(go_exp_template_html_files) +@go_include@ html/template.lo.dep +html/template.lo.dep: $(go_html_template_files) $(BUILDDEPS) -exp/template/html.lo: $(go_exp_template_html_files) +html/template.lo: $(go_html_template_files) $(BUILDPACKAGE) -exp/template/html/check: $(CHECK_DEPS) - @$(MKDIR_P) exp/template/html +html/template/check: $(CHECK_DEPS) + @$(MKDIR_P) html/template @$(CHECK) -.PHONY: exp/template/html/check +.PHONY: html/template/check @go_include@ go/ast.lo.dep go/ast.lo.dep: $(go_go_ast_files) @@ -5603,46 +5609,6 @@ hash/fnv/check: $(CHECK_DEPS) @$(CHECK) .PHONY: hash/fnv/check -@go_include@ http/cgi.lo.dep -http/cgi.lo.dep: $(go_http_cgi_files) - $(BUILDDEPS) -http/cgi.lo: $(go_http_cgi_files) - $(BUILDPACKAGE) -http/cgi/check: $(CHECK_DEPS) - @$(MKDIR_P) http/cgi - @$(CHECK) -.PHONY: http/cgi/check - -@go_include@ http/fcgi.lo.dep -http/fcgi.lo.dep: $(go_http_fcgi_files) - $(BUILDDEPS) -http/fcgi.lo: $(go_http_fcgi_files) - $(BUILDPACKAGE) -http/fcgi/check: $(CHECK_DEPS) - @$(MKDIR_P) http/fcgi - @$(CHECK) -.PHONY: http/fcgi/check - -@go_include@ http/httptest.lo.dep -http/httptest.lo.dep: $(go_http_httptest_files) - $(BUILDDEPS) -http/httptest.lo: $(go_http_httptest_files) - $(BUILDPACKAGE) -http/httptest/check: $(CHECK_DEPS) - @$(MKDIR_P) http/httptest - @$(CHECK) -.PHONY: http/httptest/check - -@go_include@ http/pprof.lo.dep -http/pprof.lo.dep: $(go_http_pprof_files) - $(BUILDDEPS) -http/pprof.lo: $(go_http_pprof_files) - $(BUILDPACKAGE) -http/pprof/check: $(CHECK_DEPS) - @$(MKDIR_P) http/pprof - @$(CHECK) -.PHONY: http/pprof/check - @go_include@ image/bmp.lo.dep image/bmp.lo.dep: $(go_image_bmp_files) $(BUILDDEPS) @@ -5743,6 +5709,48 @@ io/ioutil/check: $(CHECK_DEPS) @$(CHECK) .PHONY: io/ioutil/check +@go_include@ log/syslog.lo.dep +log/syslog.lo.dep: $(go_log_syslog_files) + $(BUILDDEPS) +log/syslog.lo: $(go_log_syslog_files) + $(BUILDPACKAGE) +log/syslog/syslog_c.lo: $(go_syslog_c_files) log/syslog.lo + $(LTCOMPILE) -c -o $@ $(srcdir)/go/log/syslog/syslog_c.c +log/syslog/check: $(CHECK_DEPS) + @$(MKDIR_P) log/syslog + @$(CHECK) +.PHONY: log/syslog/check + +@go_include@ math/big.lo.dep +math/big.lo.dep: $(go_math_big_files) + $(BUILDDEPS) +math/big.lo: $(go_math_big_files) + $(BUILDPACKAGE) +math/big/check: $(CHECK_DEPS) + @$(MKDIR_P) math/big + @$(CHECK) +.PHONY: math/big/check + +@go_include@ math/cmplx.lo.dep +math/cmplx.lo.dep: $(go_math_cmplx_files) + $(BUILDDEPS) +math/cmplx.lo: $(go_math_cmplx_files) + $(BUILDPACKAGE) +math/cmplx/check: $(CHECK_DEPS) + @$(MKDIR_P) math/cmplx + @$(CHECK) +.PHONY: math/cmplx/check + +@go_include@ math/rand.lo.dep +math/rand.lo.dep: $(go_math_rand_files) + $(BUILDDEPS) +math/rand.lo: $(go_math_rand_files) + $(BUILDPACKAGE) +math/rand/check: $(CHECK_DEPS) + @$(MKDIR_P) math/rand + @$(CHECK) +.PHONY: math/rand/check + @go_include@ mime/multipart.lo.dep mime/multipart.lo.dep: $(go_mime_multipart_files) $(BUILDDEPS) @@ -5759,6 +5767,56 @@ net/dict.lo.dep: $(go_net_dict_files) net/dict.lo: $(go_net_dict_files) $(BUILDPACKAGE) +@go_include@ net/http.lo.dep +net/http.lo.dep: $(go_net_http_files) + $(BUILDDEPS) +net/http.lo: $(go_net_http_files) + $(BUILDPACKAGE) +net/http/check: $(CHECK_DEPS) + @$(MKDIR_P) net/http + @$(CHECK) +.PHONY: net/http/check + +@go_include@ net/mail.lo.dep +net/mail.lo.dep: $(go_net_mail_files) + $(BUILDDEPS) +net/mail.lo: $(go_net_mail_files) + $(BUILDPACKAGE) +net/mail/check: $(CHECK_DEPS) + @$(MKDIR_P) net/mail + @$(CHECK) +.PHONY: net/mail/check + +@go_include@ net/rpc.lo.dep +net/rpc.lo.dep: $(go_net_rpc_files) + $(BUILDDEPS) +net/rpc.lo: $(go_net_rpc_files) + $(BUILDPACKAGE) +net/rpc/check: $(CHECK_DEPS) + @$(MKDIR_P) net/rpc + @$(CHECK) +.PHONY: net/rpc/check + +@go_include@ net/smtp.lo.dep +net/smtp.lo.dep: $(go_net_smtp_files) + $(BUILDDEPS) +net/smtp.lo: $(go_net_smtp_files) + $(BUILDPACKAGE) +net/smtp/check: $(CHECK_DEPS) + @$(MKDIR_P) net/smtp + @$(CHECK) +.PHONY: net/smtp/check + +@go_include@ net/url.lo.dep +net/url.lo.dep: $(go_net_url_files) + $(BUILDDEPS) +net/url.lo: $(go_net_url_files) + $(BUILDPACKAGE) +net/url/check: $(CHECK_DEPS) + @$(MKDIR_P) net/url + @$(CHECK) +.PHONY: net/url/check + @go_include@ net/textproto.lo.dep net/textproto.lo.dep: $(go_net_textproto_files) $(BUILDDEPS) @@ -5769,6 +5827,66 @@ net/textproto/check: $(CHECK_DEPS) @$(CHECK) .PHONY: net/textproto/check +@go_include@ net/http/cgi.lo.dep +net/http/cgi.lo.dep: $(go_net_http_cgi_files) + $(BUILDDEPS) +net/http/cgi.lo: $(go_net_http_cgi_files) + $(BUILDPACKAGE) +net/http/cgi/check: $(CHECK_DEPS) + @$(MKDIR_P) net/http/cgi + @$(CHECK) +.PHONY: net/http/cgi/check + +@go_include@ net/http/fcgi.lo.dep +net/http/fcgi.lo.dep: $(go_net_http_fcgi_files) + $(BUILDDEPS) +net/http/fcgi.lo: $(go_net_http_fcgi_files) + $(BUILDPACKAGE) +net/http/fcgi/check: $(CHECK_DEPS) + @$(MKDIR_P) net/http/fcgi + @$(CHECK) +.PHONY: net/http/fcgi/check + +@go_include@ net/http/httptest.lo.dep +net/http/httptest.lo.dep: $(go_net_http_httptest_files) + $(BUILDDEPS) +net/http/httptest.lo: $(go_net_http_httptest_files) + $(BUILDPACKAGE) +net/http/httptest/check: $(check_deps) + @$(MKDIR_P) net/http/httptest + @$(CHECK) +.PHONY: net/http/httptest/check + +@go_include@ net/http/httputil.lo.dep +net/http/httputil.lo.dep: $(go_net_http_httputil_files) + $(BUILDDEPS) +net/http/httputil.lo: $(go_net_http_httputil_files) + $(BUILDPACKAGE) +net/http/httputil/check: $(check_deps) + @$(MKDIR_P) net/http/httputil + @$(CHECK) +.PHONY: net/http/httputil/check + +@go_include@ net/http/pprof.lo.dep +net/http/pprof.lo.dep: $(go_net_http_pprof_files) + $(BUILDDEPS) +net/http/pprof.lo: $(go_net_http_pprof_files) + $(BUILDPACKAGE) +net/http/pprof/check: $(CHECK_DEPS) + @$(MKDIR_P) net/http/pprof + @$(CHECK) +.PHONY: net/http/pprof/check + +@go_include@ net/rpc/jsonrpc.lo.dep +net/rpc/jsonrpc.lo.dep: $(go_net_rpc_jsonrpc_files) + $(BUILDDEPS) +net/rpc/jsonrpc.lo: $(go_net_rpc_jsonrpc_files) + $(BUILDPACKAGE) +net/rpc/jsonrpc/check: $(CHECK_DEPS) + @$(MKDIR_P) net/rpc/jsonrpc + @$(CHECK) +.PHONY: net/rpc/jsonrpc/check + @go_include@ old/netchan.lo.dep old/netchan.lo.dep: $(go_old_netchan_files) $(BUILDDEPS) @@ -5799,6 +5917,16 @@ old/template/check: $(CHECK_DEPS) @$(CHECK) .PHONY: old/template/check +@go_include@ os/exec.lo.dep +os/exec.lo.dep: $(go_os_exec_files) + $(BUILDDEPS) +os/exec.lo: $(go_os_exec_files) + $(BUILDPACKAGE) +os/exec/check: $(CHECK_DEPS) + @$(MKDIR_P) os/exec + @$(CHECK) +.PHONY: os/exec/check + @go_include@ os/user.lo.dep os/user.lo.dep: $(go_os_user_files) $(BUILDDEPS) @@ -5839,16 +5967,6 @@ regexp/syntax/check: $(CHECK_DEPS) @$(CHECK) .PHONY: regexp/syntax/check -@go_include@ rpc/jsonrpc.lo.dep -rpc/jsonrpc.lo.dep: $(go_rpc_jsonrpc_files) - $(BUILDDEPS) -rpc/jsonrpc.lo: $(go_rpc_jsonrpc_files) - $(BUILDPACKAGE) -rpc/jsonrpc/check: $(CHECK_DEPS) - @$(MKDIR_P) rpc/jsonrpc - @$(CHECK) -.PHONY: rpc/jsonrpc/check - @go_include@ runtime/debug.lo.dep runtime/debug.lo.dep: $(go_runtime_debug_files) $(BUILDDEPS) @@ -5881,15 +5999,34 @@ sync/atomic/check: $(CHECK_DEPS) @$(CHECK) .PHONY: sync/atomic/check -@go_include@ template/parse.lo.dep -template/parse.lo.dep: $(go_template_parse_files) +@go_include@ text/tabwriter.lo.dep +text/tabwriter.lo.dep: $(go_text_tabwriter_files) $(BUILDDEPS) -template/parse.lo: $(go_template_parse_files) +text/tabwriter.lo: $(go_text_tabwriter_files) $(BUILDPACKAGE) -template/parse/check: $(CHECK_DEPS) - @$(MKDIR_P) template/parse +text/tabwriter/check: $(CHECK_DEPS) + @$(MKDIR_P) text/tabwriter @$(CHECK) -.PHONY: template/parse/check +.PHONY: text/tabwriter/check + +@go_include@ text/template.lo.dep +text/template.lo.dep: $(go_text_template_files) + $(BUILDDEPS) +text/template.lo: $(go_text_template_files) + $(BUILDPACKAGE) +text/template/check: $(CHECK_DEPS) + @$(CHECK) +.PHONY: text/template/check + +@go_include@ text/template/parse.lo.dep +text/template/parse.lo.dep: $(go_text_template_parse_files) + $(BUILDDEPS) +text/template/parse.lo: $(go_text_template_parse_files) + $(BUILDPACKAGE) +text/template/parse/check: $(CHECK_DEPS) + @$(MKDIR_P) text/template/parse + @$(CHECK) +.PHONY: text/template/parse/check @go_include@ testing/iotest.lo.dep testing/iotest.lo.dep: $(go_testing_iotest_files) @@ -5921,6 +6058,26 @@ testing/script/check: $(CHECK_DEPS) @$(CHECK) .PHONY: testing/script/check +@go_include@ unicode/utf16.lo.dep +unicode/utf16.lo.dep: $(go_unicode_utf16_files) + $(BUILDDEPS) +unicode/utf16.lo: $(go_unicode_utf16_files) + $(BUILDPACKAGE) +unicode/utf16/check: $(CHECK_DEPS) + @$(MKDIR_P) unicode/utf16 + @$(CHECK) +.PHONY: unicode/utf16/check + +@go_include@ unicode/utf8.lo.dep +unicode/utf8.lo.dep: $(go_unicode_utf8_files) + $(BUILDDEPS) +unicode/utf8.lo: $(go_unicode_utf8_files) + $(BUILDPACKAGE) +unicode/utf8/check: $(CHECK_DEPS) + @$(MKDIR_P) unicode/utf8 + @$(CHECK) +.PHONY: unicode/utf8/check + @go_include@ syscall/syscall.lo.dep syscall/syscall.lo.dep: $(go_syscall_files) $(BUILDDEPS) @@ -5931,50 +6088,32 @@ syscall/errno.lo: go/syscall/errno.c syscall/wait.lo: go/syscall/wait.c $(LTCOMPILE) -c -o $@ $< -asn1.gox: asn1/asn1.lo - $(BUILDGOX) -big.gox: big/big.lo - $(BUILDGOX) bufio.gox: bufio/bufio.lo $(BUILDGOX) bytes.gox: bytes/bytes.lo $(BUILDGOX) -cmath.gox: cmath/cmath.lo - $(BUILDGOX) crypto.gox: crypto/crypto.lo $(BUILDGOX) -csv.gox: csv/csv.lo - $(BUILDGOX) errors.gox: errors/errors.lo $(BUILDGOX) -exec.gox: exec/exec.lo - $(BUILDGOX) expvar.gox: expvar/expvar.lo $(BUILDGOX) flag.gox: flag/flag.lo $(BUILDGOX) fmt.gox: fmt/fmt.lo $(BUILDGOX) -gob.gox: gob/gob.lo - $(BUILDGOX) hash.gox: hash/hash.lo $(BUILDGOX) html.gox: html/html.lo $(BUILDGOX) -http.gox: http/http.lo - $(BUILDGOX) image.gox: image/image.lo $(BUILDGOX) io.gox: io/io.lo $(BUILDGOX) -json.gox: json/json.lo - $(BUILDGOX) log.gox: log/log.lo $(BUILDGOX) math.gox: math/math.lo $(BUILDGOX) -mail.gox: mail/mail.lo - $(BUILDGOX) mime.gox: mime/mime.lo $(BUILDGOX) net.gox: net/net.lo @@ -5985,20 +6124,12 @@ patch.gox: patch/patch.lo $(BUILDGOX) path.gox: path/path.lo $(BUILDGOX) -rand.gox: rand/rand.lo - $(BUILDGOX) reflect.gox: reflect/reflect.lo $(BUILDGOX) regexp.gox: regexp/regexp.lo $(BUILDGOX) -rpc.gox: rpc/rpc.lo - $(BUILDGOX) runtime.gox: runtime/runtime.lo $(BUILDGOX) -scanner.gox: scanner/scanner.lo - $(BUILDGOX) -smtp.gox: smtp/smtp.lo - $(BUILDGOX) sort.gox: sort/sort.lo $(BUILDGOX) strconv.gox: strconv/strconv.lo @@ -6007,30 +6138,16 @@ strings.gox: strings/strings.lo $(BUILDGOX) sync.gox: sync/sync.lo $(BUILDGOX) -syslog.gox: syslog/syslog.lo - $(BUILDGOX) syscall.gox: syscall/syscall.lo $(BUILDGOX) -tabwriter.gox: tabwriter/tabwriter.lo - $(BUILDGOX) -template.gox: template/template.lo - $(BUILDGOX) testing.gox: testing/testing.lo $(BUILDGOX) time.gox: time/time.lo $(BUILDGOX) unicode.gox: unicode/unicode.lo $(BUILDGOX) -url.gox: url/url.lo - $(BUILDGOX) -utf16.gox: utf16/utf16.lo - $(BUILDGOX) -utf8.gox: utf8/utf8.lo - $(BUILDGOX) websocket.gox: websocket/websocket.lo $(BUILDGOX) -xml.gox: xml/xml.lo - $(BUILDGOX) archive/tar.gox: archive/tar.lo $(BUILDGOX) @@ -6135,18 +6252,28 @@ debug/pe.gox: debug/pe.lo encoding/ascii85.gox: encoding/ascii85.lo $(BUILDGOX) +encoding/asn1.gox: encoding/asn1.lo + $(BUILDGOX) encoding/base32.gox: encoding/base32.lo $(BUILDGOX) encoding/base64.gox: encoding/base64.lo $(BUILDGOX) encoding/binary.gox: encoding/binary.lo $(BUILDGOX) +encoding/csv.gox: encoding/csv.lo + $(BUILDGOX) encoding/git85.gox: encoding/git85.lo $(BUILDGOX) +encoding/gob.gox: encoding/gob.lo + $(BUILDGOX) encoding/hex.gox: encoding/hex.lo $(BUILDGOX) +encoding/json.gox: encoding/json.lo + $(BUILDGOX) encoding/pem.gox: encoding/pem.lo $(BUILDGOX) +encoding/xml.gox: encoding/xml.lo + $(BUILDGOX) exp/ebnf.gox: exp/ebnf.lo $(BUILDGOX) @@ -6173,7 +6300,7 @@ exp/gui/x11.gox: exp/gui/x11.lo exp/sql/driver.gox: exp/sql/driver.lo $(BUILDGOX) -exp/template/html.gox: exp/template/html.lo +html/template.gox: html/template.lo $(BUILDGOX) go/ast.gox: go/ast.lo @@ -6200,15 +6327,6 @@ hash/crc64.gox: hash/crc64.lo hash/fnv.gox: hash/fnv.lo $(BUILDGOX) -http/cgi.gox: http/cgi.lo - $(BUILDGOX) -http/fcgi.gox: http/fcgi.lo - $(BUILDGOX) -http/httptest.gox: http/httptest.lo - $(BUILDGOX) -http/pprof.gox: http/pprof.lo - $(BUILDGOX) - image/bmp.gox: image/bmp.lo $(BUILDGOX) image/color.gox: image/color.lo @@ -6232,13 +6350,47 @@ index/suffixarray.gox: index/suffixarray.lo io/ioutil.gox: io/ioutil.lo $(BUILDGOX) +log/syslog.gox: log/syslog.lo + $(BUILDGOX) + +math/big.gox: math/big.lo + $(BUILDGOX) +math/cmplx.gox: math/cmplx.lo + $(BUILDGOX) +math/rand.gox: math/rand.lo + $(BUILDGOX) + mime/multipart.gox: mime/multipart.lo $(BUILDGOX) net/dict.gox: net/dict.lo $(BUILDGOX) +net/http.gox: net/http.lo + $(BUILDGOX) +net/mail.gox: net/mail.lo + $(BUILDGOX) +net/rpc.gox: net/rpc.lo + $(BUILDGOX) +net/smtp.gox: net/smtp.lo + $(BUILDGOX) net/textproto.gox: net/textproto.lo $(BUILDGOX) +net/url.gox: net/url.lo + $(BUILDGOX) + +net/http/cgi.gox: net/http/cgi.lo + $(BUILDGOX) +net/http/fcgi.gox: net/http/fcgi.lo + $(BUILDGOX) +net/http/httptest.gox: net/http/httptest.lo + $(BUILDGOX) +net/http/httputil.gox: net/http/httputil.lo + $(BUILDGOX) +net/http/pprof.gox: net/http/pprof.lo + $(BUILDGOX) + +net/rpc/jsonrpc.gox: net/rpc/jsonrpc.lo + $(BUILDGOX) old/netchan.gox: old/netchan.lo $(BUILDGOX) @@ -6247,6 +6399,8 @@ old/regexp.gox: old/regexp.lo old/template.gox: old/template.lo $(BUILDGOX) +os/exec.gox: os/exec.lo + $(BUILDGOX) os/user.gox: os/user.lo $(BUILDGOX) os/signal.gox: os/signal.lo @@ -6258,9 +6412,6 @@ path/filepath.gox: path/filepath.lo regexp/syntax.gox: regexp/syntax.lo $(BUILDGOX) -rpc/jsonrpc.gox: rpc/jsonrpc.lo - $(BUILDGOX) - runtime/debug.gox: runtime/debug.lo $(BUILDGOX) runtime/pprof.gox: runtime/pprof.lo @@ -6269,7 +6420,13 @@ runtime/pprof.gox: runtime/pprof.lo sync/atomic.gox: sync/atomic.lo $(BUILDGOX) -template/parse.gox: template/parse.lo +text/scanner.gox: text/scanner.lo + $(BUILDGOX) +text/tabwriter.gox: text/tabwriter.lo + $(BUILDGOX) +text/template.gox: text/template.lo + $(BUILDGOX) +text/template/parse.gox: text/template/parse.lo $(BUILDGOX) testing/iotest.gox: testing/iotest.lo @@ -6279,6 +6436,11 @@ testing/quick.gox: testing/quick.lo testing/script.gox: testing/script.lo $(BUILDGOX) +unicode/utf16.gox: unicode/utf16.lo + $(BUILDGOX) +unicode/utf8.gox: unicode/utf8.lo + $(BUILDGOX) + check: check-tail check-recursive: check-head diff --git a/libgo/go/archive/tar/reader.go b/libgo/go/archive/tar/reader.go index 65bf1204ab4..facba2cc7a3 100644 --- a/libgo/go/archive/tar/reader.go +++ b/libgo/go/archive/tar/reader.go @@ -29,7 +29,7 @@ var ( // tr := tar.NewReader(r) // for { // hdr, err := tr.Next() -// if err == os.EOF { +// if err == io.EOF { // // end of tar archive // break // } @@ -200,7 +200,7 @@ func (tr *Reader) readHeader() *Header { } // Read reads from the current entry in the tar archive. -// It returns 0, os.EOF when it reaches the end of that entry, +// It returns 0, io.EOF when it reaches the end of that entry, // until Next is called to advance to the next entry. func (tr *Reader) Read(b []byte) (n int, err error) { if tr.nb == 0 { diff --git a/libgo/go/archive/zip/reader.go b/libgo/go/archive/zip/reader.go index 64152b4245c..cfbe5498a15 100644 --- a/libgo/go/archive/zip/reader.go +++ b/libgo/go/archive/zip/reader.go @@ -7,10 +7,10 @@ package zip import ( "bufio" "compress/flate" + "encoding/binary" "errors" "hash" "hash/crc32" - "encoding/binary" "io" "io/ioutil" "os" @@ -60,6 +60,7 @@ func OpenReader(name string) (*ReadCloser, error) { f.Close() return nil, err } + r.f = f return r, nil } diff --git a/libgo/go/archive/zip/reader_test.go b/libgo/go/archive/zip/reader_test.go index 4d80aab709e..ca0b04e2bba 100644 --- a/libgo/go/archive/zip/reader_test.go +++ b/libgo/go/archive/zip/reader_test.go @@ -98,7 +98,11 @@ func readTestZip(t *testing.T, zt ZipTest) { if err == FormatError { return } - defer z.Close() + defer func() { + if err := z.Close(); err != nil { + t.Errorf("error %q when closing zip file", err) + } + }() // bail here if no Files expected to be tested // (there may actually be files in the zip, but we don't care) diff --git a/libgo/go/archive/zip/writer_test.go b/libgo/go/archive/zip/writer_test.go index b562f843053..25491dc753d 100644 --- a/libgo/go/archive/zip/writer_test.go +++ b/libgo/go/archive/zip/writer_test.go @@ -7,7 +7,7 @@ package zip import ( "bytes" "io/ioutil" - "rand" + "math/rand" "testing" ) diff --git a/libgo/go/bufio/bufio.go b/libgo/go/bufio/bufio.go index f4ed91b24b4..61e338b6165 100644 --- a/libgo/go/bufio/bufio.go +++ b/libgo/go/bufio/bufio.go @@ -11,7 +11,7 @@ import ( "bytes" "io" "strconv" - "utf8" + "unicode/utf8" ) const ( @@ -135,7 +135,7 @@ func (b *Reader) Peek(n int) ([]byte, error) { // It returns the number of bytes read into p. // It calls Read at most once on the underlying Reader, // hence n may be less than len(p). -// At EOF, the count will be zero and err will be os.EOF. +// At EOF, the count will be zero and err will be io.EOF. func (b *Reader) Read(p []byte) (n int, err error) { n = len(p) if n == 0 { @@ -246,7 +246,7 @@ func (b *Reader) Buffered() int { return b.w - b.r } // returning a slice pointing at the bytes in the buffer. // The bytes stop being valid at the next read call. // If ReadSlice encounters an error before finding a delimiter, -// it returns all the data in the buffer and the error itself (often os.EOF). +// it returns all the data in the buffer and the error itself (often io.EOF). // ReadSlice fails with error ErrBufferFull if the buffer fills without a delim. // Because the data returned from ReadSlice will be overwritten // by the next I/O operation, most clients should use @@ -312,6 +312,9 @@ func (b *Reader) ReadLine() (line []byte, isPrefix bool, err error) { } if len(line) == 0 { + if err != nil { + line = nil + } return } err = nil @@ -329,7 +332,7 @@ func (b *Reader) ReadLine() (line []byte, isPrefix bool, err error) { // ReadBytes reads until the first occurrence of delim in the input, // returning a slice containing the data up to and including the delimiter. // If ReadBytes encounters an error before finding a delimiter, -// it returns the data read before the error and the error itself (often os.EOF). +// it returns the data read before the error and the error itself (often io.EOF). // ReadBytes returns err != nil if and only if the returned data does not end in // delim. func (b *Reader) ReadBytes(delim byte) (line []byte, err error) { @@ -376,7 +379,7 @@ func (b *Reader) ReadBytes(delim byte) (line []byte, err error) { // ReadString reads until the first occurrence of delim in the input, // returning a string containing the data up to and including the delimiter. // If ReadString encounters an error before finding a delimiter, -// it returns the data read before the error and the error itself (often os.EOF). +// it returns the data read before the error and the error itself (often io.EOF). // ReadString returns err != nil if and only if the returned data does not end in // delim. func (b *Reader) ReadString(delim byte) (line string, err error) { diff --git a/libgo/go/bufio/bufio_test.go b/libgo/go/bufio/bufio_test.go index 0285deeb3d1..1f893951c15 100644 --- a/libgo/go/bufio/bufio_test.go +++ b/libgo/go/bufio/bufio_test.go @@ -14,7 +14,7 @@ import ( "strings" "testing" "testing/iotest" - "utf8" + "unicode/utf8" ) // Reads from a reader and rot13s the result. @@ -698,6 +698,17 @@ func TestLinesAfterRead(t *testing.T) { } } +func TestReadLineNonNilLineOrError(t *testing.T) { + r := NewReader(strings.NewReader("line 1\n")) + for i := 0; i < 2; i++ { + l, _, err := r.ReadLine() + if l != nil && err != nil { + t.Fatalf("on line %d/2; ReadLine=%#v, %v; want non-nil line or Error, but not both", + i+1, l, err) + } + } +} + type readLineResult struct { line []byte isPrefix bool diff --git a/libgo/go/builtin/builtin.go b/libgo/go/builtin/builtin.go index 07acce4f700..5a7aaf364db 100644 --- a/libgo/go/builtin/builtin.go +++ b/libgo/go/builtin/builtin.go @@ -3,13 +3,89 @@ // license that can be found in the LICENSE file. /* - Package builtin provides documentation for Go's built-in functions. - The functions documented here are not actually in package builtin + Package builtin provides documentation for Go's predeclared identifiers. + The items documented here are not actually in package builtin but their descriptions here allow godoc to present documentation - for the language's special functions. + for the language's special identifiers. */ package builtin +// bool is the set of boolean values, true and false. +type bool bool + +// uint8 is the set of all unsigned 8-bit integers. +// Range: 0 through 255. +type uint8 uint8 + +// uint16 is the set of all unsigned 16-bit integers. +// Range: 0 through 65535. +type uint16 uint16 + +// uint32 is the set of all unsigned 32-bit integers. +// Range: 0 through 4294967295. +type uint32 uint32 + +// uint64 is the set of all unsigned 64-bit integers. +// Range: 0 through 18446744073709551615. +type uint64 uint64 + +// int8 is the set of all signed 8-bit integers. +// Range: -128 through 127. +type int8 int8 + +// int16 is the set of all signed 16-bit integers. +// Range: -32768 through 32767. +type int16 int16 + +// int32 is the set of all signed 32-bit integers. +// Range: -2147483648 through 2147483647. +type int32 int32 + +// int64 is the set of all signed 64-bit integers. +// Range: -9223372036854775808 through 9223372036854775807. +type int64 int64 + +// float32 is the set of all IEEE-754 32-bit floating-point numbers. +type float32 float32 + +// float64 is the set of all IEEE-754 64-bit floating-point numbers. +type float64 float64 + +// complex64 is the set of all complex numbers with float32 real and +// imaginary parts. +type complex64 complex64 + +// complex128 is the set of all complex numbers with float64 real and +// imaginary parts. +type complex128 complex128 + +// string is the set of all strings of 8-bit bytes, conventionally but not +// necessarily representing UTF-8-encoded text. A string may be empty, but +// not nil. Values of string type are immutable. +type string string + +// int is a signed integer type that is at least 32 bits in size. It is a +// distinct type, however, and not an alias for, say, int32. +type int int + +// uint is an unsigned integer type that is at least 32 bits in size. It is a +// distinct type, however, and not an alias for, say, uint32. +type uint uint + +// uintptr is an integer type that is large enough to hold the bit pattern of +// any pointer. +type uintptr uintptr + +// byte is an alias for uint8 and is equivalent to uint8 in all ways. It is +// used, by convention, to distinguish byte values from 8-bit unsigned +// integer values. +type byte byte + +// rune is an alias for int and is equivalent to int in all ways. It is +// used, by convention, to distinguish character values from integer values. +// In a future version of Go, it will change to an alias of int32. +type rune rune + // Type is here for the purposes of documentation only. It is a stand-in // for any Go type, but represents the same type for any given function // invocation. @@ -21,11 +97,11 @@ type IntegerType int // FloatType is here for the purposes of documentation only. It is a stand-in // for either float type: float32 or float64. -type FloatType int +type FloatType float32 // ComplexType is here for the purposes of documentation only. It is a // stand-in for either complex type: complex64 or complex128. -type ComplexType int +type ComplexType complex64 // The append built-in function appends elements to the end of a slice. If // it has sufficient capacity, the destination is resliced to accommodate the @@ -133,3 +209,9 @@ func panic(v interface{}) // nil. Thus the return value from recover reports whether the goroutine is // panicking. func recover() interface{} + +// The error built-in interface type is the conventional interface for +// representing an error condition, with the nil value representing no error. +type error interface { + Error() string +} diff --git a/libgo/go/bytes/buffer.go b/libgo/go/bytes/buffer.go index fbfd6210b64..e66ac026e5b 100644 --- a/libgo/go/bytes/buffer.go +++ b/libgo/go/bytes/buffer.go @@ -9,7 +9,7 @@ package bytes import ( "errors" "io" - "utf8" + "unicode/utf8" ) // A Buffer is a variable-sized buffer of bytes with Read and Write methods. @@ -117,7 +117,7 @@ const MinRead = 512 // ReadFrom reads data from r until EOF and appends it to the buffer. // The return value n is the number of bytes read. -// Any error except os.EOF encountered during the read +// Any error except io.EOF encountered during the read // is also returned. func (b *Buffer) ReadFrom(r io.Reader) (n int64, err error) { b.lastRead = opInvalid @@ -200,7 +200,7 @@ func (b *Buffer) WriteRune(r rune) (n int, err error) { // Read reads the next len(p) bytes from the buffer or until the buffer // is drained. The return value n is the number of bytes read. If the -// buffer has no data to return, err is os.EOF even if len(p) is zero; +// buffer has no data to return, err is io.EOF even if len(p) is zero; // otherwise it is nil. func (b *Buffer) Read(p []byte) (n int, err error) { b.lastRead = opInvalid @@ -236,7 +236,7 @@ func (b *Buffer) Next(n int) []byte { } // ReadByte reads and returns the next byte from the buffer. -// If no byte is available, it returns error os.EOF. +// If no byte is available, it returns error io.EOF. func (b *Buffer) ReadByte() (c byte, err error) { b.lastRead = opInvalid if b.off >= len(b.buf) { @@ -252,7 +252,7 @@ func (b *Buffer) ReadByte() (c byte, err error) { // ReadRune reads and returns the next UTF-8-encoded // Unicode code point from the buffer. -// If no bytes are available, the error returned is os.EOF. +// If no bytes are available, the error returned is io.EOF. // If the bytes are an erroneous UTF-8 encoding, it // consumes one byte and returns U+FFFD, 1. func (b *Buffer) ReadRune() (r rune, size int, err error) { @@ -307,7 +307,7 @@ func (b *Buffer) UnreadByte() error { // ReadBytes reads until the first occurrence of delim in the input, // returning a slice containing the data up to and including the delimiter. // If ReadBytes encounters an error before finding a delimiter, -// it returns the data read before the error and the error itself (often os.EOF). +// it returns the data read before the error and the error itself (often io.EOF). // ReadBytes returns err != nil if and only if the returned data does not end in // delim. func (b *Buffer) ReadBytes(delim byte) (line []byte, err error) { @@ -326,7 +326,7 @@ func (b *Buffer) ReadBytes(delim byte) (line []byte, err error) { // ReadString reads until the first occurrence of delim in the input, // returning a string containing the data up to and including the delimiter. // If ReadString encounters an error before finding a delimiter, -// it returns the data read before the error and the error itself (often os.EOF). +// it returns the data read before the error and the error itself (often io.EOF). // ReadString returns err != nil if and only if the returned data does not end // in delim. func (b *Buffer) ReadString(delim byte) (line string, err error) { diff --git a/libgo/go/bytes/buffer_test.go b/libgo/go/bytes/buffer_test.go index c271b482e15..52359700322 100644 --- a/libgo/go/bytes/buffer_test.go +++ b/libgo/go/bytes/buffer_test.go @@ -7,9 +7,9 @@ package bytes_test import ( . "bytes" "io" - "rand" + "math/rand" "testing" - "utf8" + "unicode/utf8" ) const N = 10000 // make this bigger for a larger (and slower) test diff --git a/libgo/go/bytes/bytes.go b/libgo/go/bytes/bytes.go index ac8320fe6b4..9bfd88fa398 100644 --- a/libgo/go/bytes/bytes.go +++ b/libgo/go/bytes/bytes.go @@ -8,7 +8,7 @@ package bytes import ( "unicode" - "utf8" + "unicode/utf8" ) // Compare returns an integer comparing the two byte arrays lexicographically. @@ -88,6 +88,11 @@ func Count(s, sep []byte) int { return n } +// Contains returns whether subslice is within b. +func Contains(b, subslice []byte) bool { + return Index(b, subslice) != -1 +} + // Index returns the index of the first instance of sep in s, or -1 if sep is not present in s. func Index(s, sep []byte) int { n := len(sep) diff --git a/libgo/go/bytes/bytes_test.go b/libgo/go/bytes/bytes_test.go index 62f258de8ac..9256b184274 100644 --- a/libgo/go/bytes/bytes_test.go +++ b/libgo/go/bytes/bytes_test.go @@ -9,7 +9,7 @@ import ( "reflect" "testing" "unicode" - "utf8" + "unicode/utf8" ) func eq(a, b []string) bool { diff --git a/libgo/go/compress/bzip2/bit_reader.go b/libgo/go/compress/bzip2/bit_reader.go index d058c14833b..b2c13e50ca4 100644 --- a/libgo/go/compress/bzip2/bit_reader.go +++ b/libgo/go/compress/bzip2/bit_reader.go @@ -37,7 +37,7 @@ func newBitReader(r io.Reader) bitReader { // ReadBits64 reads the given number of bits and returns them in the // least-significant part of a uint64. In the event of an error, it returns 0 -// and the error can be obtained by calling Error(). +// and the error can be obtained by calling Err(). func (br *bitReader) ReadBits64(bits uint) (n uint64) { for bits > br.bits { b, err := br.r.ReadByte() @@ -82,6 +82,6 @@ func (br *bitReader) ReadBit() bool { return n != 0 } -func (br *bitReader) Error() error { +func (br *bitReader) Err() error { return br.err } diff --git a/libgo/go/compress/bzip2/bzip2.go b/libgo/go/compress/bzip2/bzip2.go index 343cca03e34..3dc8c620615 100644 --- a/libgo/go/compress/bzip2/bzip2.go +++ b/libgo/go/compress/bzip2/bzip2.go @@ -80,7 +80,7 @@ func (bz2 *reader) Read(buf []byte) (n int, err error) { if !bz2.setupDone { err = bz2.setup() - brErr := bz2.br.Error() + brErr := bz2.br.Err() if brErr != nil { err = brErr } @@ -91,7 +91,7 @@ func (bz2 *reader) Read(buf []byte) (n int, err error) { } n, err = bz2.read(buf) - brErr := bz2.br.Error() + brErr := bz2.br.Err() if brErr != nil { err = brErr } diff --git a/libgo/go/compress/zlib/testdata/e.txt b/libgo/go/compress/zlib/testdata/e.txt deleted file mode 100644 index 76cf2a7b691..00000000000 --- a/libgo/go/compress/zlib/testdata/e.txt +++ /dev/null @@ -1 +0,0 @@ -2.7182818284590452353602874713526624977572470936999595749669676277240766303535475945713821785251664274274663919320030599218174135966290435729003342952605956307381323286279434907632338298807531952510190115738341879307021540891499348841675092447614606680822648001684774118537423454424371075390777449920695517027618386062613313845830007520449338265602976067371132007093287091274437470472306969772093101416928368190255151086574637721112523897844250569536967707854499699679468644549059879316368892300987931277361782154249992295763514822082698951936680331825288693984964651058209392398294887933203625094431173012381970684161403970198376793206832823764648042953118023287825098194558153017567173613320698112509961818815930416903515988885193458072738667385894228792284998920868058257492796104841984443634632449684875602336248270419786232090021609902353043699418491463140934317381436405462531520961836908887070167683964243781405927145635490613031072085103837505101157477041718986106873969655212671546889570350354021234078498193343210681701210056278802351930332247450158539047304199577770935036604169973297250886876966403555707162268447162560798826517871341951246652010305921236677194325278675398558944896970964097545918569563802363701621120477427228364896134225164450781824423529486363721417402388934412479635743702637552944483379980161254922785092577825620926226483262779333865664816277251640191059004916449982893150566047258027786318641551956532442586982946959308019152987211725563475463964479101459040905862984967912874068705048958586717479854667757573205681288459205413340539220001137863009455606881667400169842055804033637953764520304024322566135278369511778838638744396625322498506549958862342818997077332761717839280349465014345588970719425863987727547109629537415211151368350627526023264847287039207643100595841166120545297030236472549296669381151373227536450988890313602057248176585118063036442812314965507047510254465011727211555194866850800368532281831521960037356252794495158284188294787610852639813955990067376482922443752871846245780361929819713991475644882626039033814418232625150974827987779964373089970388867782271383605772978824125611907176639465070633045279546618550966661856647097113444740160704626215680717481877844371436988218559670959102596862002353718588748569652200050311734392073211390803293634479727355955277349071783793421637012050054513263835440001863239914907054797780566978533580489669062951194324730995876552368128590413832411607226029983305353708761389396391779574540161372236187893652605381558415871869255386061647798340254351284396129460352913325942794904337299085731580290958631382683291477116396337092400316894586360606458459251269946557248391865642097526850823075442545993769170419777800853627309417101634349076964237222943523661255725088147792231519747780605696725380171807763603462459278778465850656050780844211529697521890874019660906651803516501792504619501366585436632712549639908549144200014574760819302212066024330096412704894390397177195180699086998606636583232278709376502260149291011517177635944602023249300280401867723910288097866605651183260043688508817157238669842242201024950551881694803221002515426494639812873677658927688163598312477886520141174110913601164995076629077943646005851941998560162647907615321038727557126992518275687989302761761146162549356495903798045838182323368612016243736569846703785853305275833337939907521660692380533698879565137285593883499894707416181550125397064648171946708348197214488898790676503795903669672494992545279033729636162658976039498576741397359441023744329709355477982629614591442936451428617158587339746791897571211956187385783644758448423555581050025611492391518893099463428413936080383091662818811503715284967059741625628236092168075150177725387402564253470879089137291722828611515915683725241630772254406337875931059826760944203261924285317018781772960235413060672136046000389661093647095141417185777014180606443636815464440053316087783143174440811949422975599314011888683314832802706553833004693290115744147563139997221703804617092894579096271662260740718749975359212756084414737823303270330168237193648002173285734935947564334129943024850235732214597843282641421684878721673367010615094243456984401873312810107945127223737886126058165668053714396127888732527373890392890506865324138062796025930387727697783792868409325365880733988457218746021005311483351323850047827169376218004904795597959290591655470505777514308175112698985188408718564026035305583737832422924185625644255022672155980274012617971928047139600689163828665277009752767069777036439260224372841840883251848770472638440379530166905465937461619323840363893131364327137688841026811219891275223056256756254701725086349765367288605966752740868627407912856576996313789753034660616669804218267724560530660773899624218340859882071864682623215080288286359746839654358856685503773131296587975810501214916207656769950659715344763470320853215603674828608378656803073062657633469774295634643716709397193060876963495328846833613038829431040800296873869117066666146800015121143442256023874474325250769387077775193299942137277211258843608715834835626961661980572526612206797540621062080649882918454395301529982092503005498257043390553570168653120526495614857249257386206917403695213533732531666345466588597286659451136441370331393672118569553952108458407244323835586063106806964924851232632699514603596037297253198368423363904632136710116192821711150282801604488058802382031981493096369596735832742024988245684941273860566491352526706046234450549227581151709314921879592718001940968866986837037302200475314338181092708030017205935530520700706072233999463990571311587099635777359027196285061146514837526209565346713290025994397663114545902685898979115837093419370441155121920117164880566945938131183843765620627846310490346293950029458341164824114969758326011800731699437393506966295712410273239138741754923071862454543222039552735295240245903805744502892246886285336542213815722131163288112052146489805180092024719391710555390113943316681515828843687606961102505171007392762385553386272553538830960671644662370922646809671254061869502143176211668140097595281493907222601112681153108387317617323235263605838173151034595736538223534992935822836851007810884634349983518404451704270189381994243410090575376257767571118090088164183319201962623416288166521374717325477727783488774366518828752156685719506371936565390389449366421764003121527870222366463635755503565576948886549500270853923617105502131147413744106134445544192101336172996285694899193369184729478580729156088510396781959429833186480756083679551496636448965592948187851784038773326247051945050419847742014183947731202815886845707290544057510601285258056594703046836344592652552137008068752009593453607316226118728173928074623094685367823106097921599360019946237993434210687813497346959246469752506246958616909178573976595199392993995567542714654910456860702099012606818704984178079173924071945996323060254707901774527513186809982284730860766536866855516467702911336827563107223346726113705490795365834538637196235856312618387156774118738527722922594743373785695538456246801013905727871016512966636764451872465653730402443684140814488732957847348490003019477888020460324660842875351848364959195082888323206522128104190448047247949291342284951970022601310430062410717971502793433263407995960531446053230488528972917659876016667811937932372453857209607582277178483361613582612896226118129455927462767137794487586753657544861407611931125958512655759734573015333642630767985443385761715333462325270572005303988289499034259566232975782488735029259166825894456894655992658454762694528780516501720674785417887982276806536650641910973434528878338621726156269582654478205672987756426325321594294418039943217000090542650763095588465895171709147607437136893319469090981904501290307099566226620303182649365733698419555776963787624918852865686607600566025605445711337286840205574416030837052312242587223438854123179481388550075689381124935386318635287083799845692619981794523364087429591180747453419551420351726184200845509170845682368200897739455842679214273477560879644279202708312150156406341341617166448069815483764491573900121217041547872591998943825364950514771379399147205219529079396137621107238494290616357604596231253506068537651423115349665683715116604220796394466621163255157729070978473156278277598788136491951257483328793771571459091064841642678309949723674420175862269402159407924480541255360431317992696739157542419296607312393763542139230617876753958711436104089409966089471418340698362993675362621545247298464213752891079884381306095552622720837518629837066787224430195793793786072107254277289071732854874374355781966511716618330881129120245204048682200072344035025448202834254187884653602591506445271657700044521097735585897622655484941621714989532383421600114062950718490427789258552743035221396835679018076406042138307308774460170842688272261177180842664333651780002171903449234264266292261456004337383868335555343453004264818473989215627086095650629340405264943244261445665921291225648893569655009154306426134252668472594914314239398845432486327461842846655985332312210466259890141712103446084271616619001257195870793217569698544013397622096749454185407118446433946990162698351607848924514058940946395267807354579700307051163682519487701189764002827648414160587206184185297189154019688253289309149665345753571427318482016384644832499037886069008072709327673127581966563941148961716832980455139729506687604740915420428429993541025829113502241690769431668574242522509026939034814856451303069925199590436384028429267412573422447765584177886171737265462085498294498946787350929581652632072258992368768457017823038096567883112289305809140572610865884845873101658151167533327674887014829167419701512559782572707406431808601428149024146780472327597684269633935773542930186739439716388611764209004068663398856841681003872389214483176070116684503887212364367043314091155733280182977988736590916659612402021778558854876176161989370794380056663364884365089144805571039765214696027662583599051987042300179465536788 diff --git a/libgo/go/compress/zlib/testdata/pi.txt b/libgo/go/compress/zlib/testdata/pi.txt deleted file mode 100644 index 58d8f3b6dd4..00000000000 --- a/libgo/go/compress/zlib/testdata/pi.txt +++ /dev/null @@ -1 +0,0 @@ -3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632788659361533818279682303019520353018529689957736225994138912497217752834791315155748572424541506959508295331168617278558890750983817546374649393192550604009277016711390098488240128583616035637076601047101819429555961989467678374494482553797747268471040475346462080466842590694912933136770289891521047521620569660240580381501935112533824300355876402474964732639141992726042699227967823547816360093417216412199245863150302861829745557067498385054945885869269956909272107975093029553211653449872027559602364806654991198818347977535663698074265425278625518184175746728909777727938000816470600161452491921732172147723501414419735685481613611573525521334757418494684385233239073941433345477624168625189835694855620992192221842725502542568876717904946016534668049886272327917860857843838279679766814541009538837863609506800642251252051173929848960841284886269456042419652850222106611863067442786220391949450471237137869609563643719172874677646575739624138908658326459958133904780275900994657640789512694683983525957098258226205224894077267194782684826014769909026401363944374553050682034962524517493996514314298091906592509372216964615157098583874105978859597729754989301617539284681382686838689427741559918559252459539594310499725246808459872736446958486538367362226260991246080512438843904512441365497627807977156914359977001296160894416948685558484063534220722258284886481584560285060168427394522674676788952521385225499546667278239864565961163548862305774564980355936345681743241125150760694794510965960940252288797108931456691368672287489405601015033086179286809208747609178249385890097149096759852613655497818931297848216829989487226588048575640142704775551323796414515237462343645428584447952658678210511413547357395231134271661021359695362314429524849371871101457654035902799344037420073105785390621983874478084784896833214457138687519435064302184531910484810053706146806749192781911979399520614196634287544406437451237181921799983910159195618146751426912397489409071864942319615679452080951465502252316038819301420937621378559566389377870830390697920773467221825625996615014215030680384477345492026054146659252014974428507325186660021324340881907104863317346496514539057962685610055081066587969981635747363840525714591028970641401109712062804390397595156771577004203378699360072305587631763594218731251471205329281918261861258673215791984148488291644706095752706957220917567116722910981690915280173506712748583222871835209353965725121083579151369882091444210067510334671103141267111369908658516398315019701651511685171437657618351556508849099898599823873455283316355076479185358932261854896321329330898570642046752590709154814165498594616371802709819943099244889575712828905923233260972997120844335732654893823911932597463667305836041428138830320382490375898524374417029132765618093773444030707469211201913020330380197621101100449293215160842444859637669838952286847831235526582131449576857262433441893039686426243410773226978028073189154411010446823252716201052652272111660396665573092547110557853763466820653109896526918620564769312570586356620185581007293606598764861179104533488503461136576867532494416680396265797877185560845529654126654085306143444318586769751456614068007002378776591344017127494704205622305389945613140711270004078547332699390814546646458807972708266830634328587856983052358089330657574067954571637752542021149557615814002501262285941302164715509792592309907965473761255176567513575178296664547791745011299614890304639947132962107340437518957359614589019389713111790429782856475032031986915140287080859904801094121472213179476477726224142548545403321571853061422881375850430633217518297986622371721591607716692547487389866549494501146540628433663937900397692656721463853067360965712091807638327166416274888800786925602902284721040317211860820419000422966171196377921337575114959501566049631862947265473642523081770367515906735023507283540567040386743513622224771589150495309844489333096340878076932599397805419341447377441842631298608099888687413260472156951623965864573021631598193195167353812974167729478672422924654366800980676928238280689964004824354037014163149658979409243237896907069779422362508221688957383798623001593776471651228935786015881617557829735233446042815126272037343146531977774160319906655418763979293344195215413418994854447345673831624993419131814809277771038638773431772075456545322077709212019051660962804909263601975988281613323166636528619326686336062735676303544776280350450777235547105859548702790814356240145171806246436267945612753181340783303362542327839449753824372058353114771199260638133467768796959703098339130771098704085913374641442822772634659470474587847787201927715280731767907707157213444730605700733492436931138350493163128404251219256517980694113528013147013047816437885185290928545201165839341965621349143415956258658655705526904965209858033850722426482939728584783163057777560688876446248246857926039535277348030480290058760758251047470916439613626760449256274204208320856611906254543372131535958450687724602901618766795240616342522577195429162991930645537799140373404328752628889639958794757291746426357455254079091451357111369410911939325191076020825202618798531887705842972591677813149699009019211697173727847684726860849003377024242916513005005168323364350389517029893922334517220138128069650117844087451960121228599371623130171144484640903890644954440061986907548516026327505298349187407866808818338510228334508504860825039302133219715518430635455007668282949304137765527939751754613953984683393638304746119966538581538420568533862186725233402830871123282789212507712629463229563989898935821167456270102183564622013496715188190973038119800497340723961036854066431939509790190699639552453005450580685501956730229219139339185680344903982059551002263535361920419947455385938102343955449597783779023742161727111723643435439478221818528624085140066604433258885698670543154706965747458550332323342107301545940516553790686627333799585115625784322988273723198987571415957811196358330059408730681216028764962867446047746491599505497374256269010490377819868359381465741268049256487985561453723478673303904688383436346553794986419270563872931748723320837601123029911367938627089438799362016295154133714248928307220126901475466847653576164773794675200490757155527819653621323926406160136358155907422020203187277605277219005561484255518792530343513984425322341576233610642506390497500865627109535919465897514131034822769306247435363256916078154781811528436679570611086153315044521274739245449454236828860613408414863776700961207151249140430272538607648236341433462351897576645216413767969031495019108575984423919862916421939949072362346468441173940326591840443780513338945257423995082965912285085558215725031071257012668302402929525220118726767562204154205161841634847565169998116141010029960783869092916030288400269104140792886215078424516709087000699282120660418371806535567252532567532861291042487761825829765157959847035622262934860034158722980534989650226291748788202734209222245339856264766914905562842503912757710284027998066365825488926488025456610172967026640765590429099456815065265305371829412703369313785178609040708667114965583434347693385781711386455873678123014587687126603489139095620099393610310291616152881384379099042317473363948045759314931405297634757481193567091101377517210080315590248530906692037671922033229094334676851422144773793937517034436619910403375111735471918550464490263655128162288244625759163330391072253837421821408835086573917715096828874782656995995744906617583441375223970968340800535598491754173818839994469748676265516582765848358845314277568790029095170283529716344562129640435231176006651012412006597558512761785838292041974844236080071930457618932349229279650198751872127267507981255470958904556357921221033346697499235630254947802490114195212382815309114079073860251522742995818072471625916685451333123948049470791191532673430282441860414263639548000448002670496248201792896476697583183271314251702969234889627668440323260927524960357996469256504936818360900323809293459588970695365349406034021665443755890045632882250545255640564482465151875471196218443965825337543885690941130315095261793780029741207665147939425902989695946995565761218656196733786236256125216320862869222103274889218654364802296780705765615144632046927906821207388377814233562823608963208068222468012248261177185896381409183903673672220888321513755600372798394004152970028783076670944474560134556417254370906979396122571429894671543578468788614445812314593571984922528471605049221242470141214780573455105008019086996033027634787081081754501193071412233908663938339529425786905076431006383519834389341596131854347546495569781038293097164651438407007073604112373599843452251610507027056235266012764848308407611830130527932054274628654036036745328651057065874882256981579367897669742205750596834408697350201410206723585020072452256326513410559240190274216248439140359989535394590944070469120914093870012645600162374288021092764579310657922955249887275846101264836999892256959688159205600101655256375678 diff --git a/libgo/go/container/heap/heap.go b/libgo/go/container/heap/heap.go index 2dfe5b43ca7..ca911396754 100644 --- a/libgo/go/container/heap/heap.go +++ b/libgo/go/container/heap/heap.go @@ -11,14 +11,17 @@ import "sort" // Any type that implements heap.Interface may be used as a // min-heap with the following invariants (established after -// Init has been called): +// Init has been called or if the data is empty or sorted): // // !h.Less(j, i) for 0 <= i < h.Len() and j = 2*i+1 or 2*i+2 and j < h.Len() // +// Note that Push and Pop in this interface are for package heap's +// implementation to call. To add and remove things from the heap, +// use heap.Push and heap.Pop. type Interface interface { sort.Interface - Push(x interface{}) - Pop() interface{} + Push(x interface{}) // add x as element Len() + Pop() interface{} // remove and return element Len() - 1. } // A heap must be initialized before any of the heap operations diff --git a/libgo/go/container/heap/heap_test.go b/libgo/go/container/heap/heap_test.go index 6625e3a2b0f..cb31ef6d30a 100644 --- a/libgo/go/container/heap/heap_test.go +++ b/libgo/go/container/heap/heap_test.go @@ -5,8 +5,8 @@ package heap_test import ( - "testing" . "container/heap" + "testing" ) type myHeap []int diff --git a/libgo/go/crypto/dsa/dsa.go b/libgo/go/crypto/dsa/dsa.go index 692d62aa9ef..a2adc7eb5c3 100644 --- a/libgo/go/crypto/dsa/dsa.go +++ b/libgo/go/crypto/dsa/dsa.go @@ -6,9 +6,9 @@ package dsa import ( - "big" "errors" "io" + "math/big" ) // Parameters represents the domain parameters for a key. These parameters can diff --git a/libgo/go/crypto/dsa/dsa_test.go b/libgo/go/crypto/dsa/dsa_test.go index deec08dfd8a..177aa444dfd 100644 --- a/libgo/go/crypto/dsa/dsa_test.go +++ b/libgo/go/crypto/dsa/dsa_test.go @@ -5,8 +5,8 @@ package dsa import ( - "big" "crypto/rand" + "math/big" "testing" ) diff --git a/libgo/go/crypto/ecdsa/ecdsa.go b/libgo/go/crypto/ecdsa/ecdsa.go index b7f235b3b10..2f199990c24 100644 --- a/libgo/go/crypto/ecdsa/ecdsa.go +++ b/libgo/go/crypto/ecdsa/ecdsa.go @@ -13,9 +13,9 @@ package ecdsa // http://www.secg.org/download/aid-780/sec1-v2.pdf import ( - "big" "crypto/elliptic" "io" + "math/big" ) // PublicKey represents an ECDSA public key. diff --git a/libgo/go/crypto/ecdsa/ecdsa_test.go b/libgo/go/crypto/ecdsa/ecdsa_test.go index d6b40391421..22360b5708c 100644 --- a/libgo/go/crypto/ecdsa/ecdsa_test.go +++ b/libgo/go/crypto/ecdsa/ecdsa_test.go @@ -5,11 +5,11 @@ package ecdsa import ( - "big" "crypto/elliptic" - "crypto/sha1" "crypto/rand" + "crypto/sha1" "encoding/hex" + "math/big" "testing" ) diff --git a/libgo/go/crypto/elliptic/elliptic.go b/libgo/go/crypto/elliptic/elliptic.go index 3c3327fe030..b7232a2fad0 100644 --- a/libgo/go/crypto/elliptic/elliptic.go +++ b/libgo/go/crypto/elliptic/elliptic.go @@ -14,8 +14,8 @@ package elliptic // reverse the transform than to operate in affine coordinates. import ( - "big" "io" + "math/big" "sync" ) diff --git a/libgo/go/crypto/elliptic/elliptic_test.go b/libgo/go/crypto/elliptic/elliptic_test.go index 9578364b58f..a68a3807dfd 100644 --- a/libgo/go/crypto/elliptic/elliptic_test.go +++ b/libgo/go/crypto/elliptic/elliptic_test.go @@ -5,9 +5,9 @@ package elliptic import ( - "big" "crypto/rand" "fmt" + "math/big" "testing" ) diff --git a/libgo/go/crypto/hmac/hmac_test.go b/libgo/go/crypto/hmac/hmac_test.go index bcae63b8af8..03431c92f75 100644 --- a/libgo/go/crypto/hmac/hmac_test.go +++ b/libgo/go/crypto/hmac/hmac_test.go @@ -5,8 +5,8 @@ package hmac import ( - "hash" "fmt" + "hash" "testing" ) diff --git a/libgo/go/crypto/ocsp/ocsp.go b/libgo/go/crypto/ocsp/ocsp.go index f697fa170c4..a04b5bd7135 100644 --- a/libgo/go/crypto/ocsp/ocsp.go +++ b/libgo/go/crypto/ocsp/ocsp.go @@ -8,12 +8,12 @@ package ocsp import ( - "asn1" "crypto" "crypto/rsa" _ "crypto/sha1" "crypto/x509" "crypto/x509/pkix" + "encoding/asn1" "time" ) diff --git a/libgo/go/crypto/openpgp/armor/armor.go b/libgo/go/crypto/openpgp/armor/armor.go index 707bdf354b3..3bbb5dc351a 100644 --- a/libgo/go/crypto/openpgp/armor/armor.go +++ b/libgo/go/crypto/openpgp/armor/armor.go @@ -151,7 +151,7 @@ func (r *openpgpReader) Read(p []byte) (n int, err error) { } // Decode reads a PGP armored block from the given Reader. It will ignore -// leading garbage. If it doesn't find a block, it will return nil, os.EOF. The +// leading garbage. If it doesn't find a block, it will return nil, io.EOF. The // given Reader is not usable after calling this function: an arbitrary amount // of data may have been read past the end of the block. func Decode(in io.Reader) (p *Block, err error) { diff --git a/libgo/go/crypto/openpgp/elgamal/elgamal.go b/libgo/go/crypto/openpgp/elgamal/elgamal.go index 2ed49f62133..a553bdee8dd 100644 --- a/libgo/go/crypto/openpgp/elgamal/elgamal.go +++ b/libgo/go/crypto/openpgp/elgamal/elgamal.go @@ -13,11 +13,11 @@ package elgamal import ( - "big" "crypto/rand" "crypto/subtle" "errors" "io" + "math/big" ) // PublicKey represents an ElGamal public key. diff --git a/libgo/go/crypto/openpgp/elgamal/elgamal_test.go b/libgo/go/crypto/openpgp/elgamal/elgamal_test.go index 101121aa658..c4f99f5c48c 100644 --- a/libgo/go/crypto/openpgp/elgamal/elgamal_test.go +++ b/libgo/go/crypto/openpgp/elgamal/elgamal_test.go @@ -5,9 +5,9 @@ package elgamal import ( - "big" "bytes" "crypto/rand" + "math/big" "testing" ) diff --git a/libgo/go/crypto/openpgp/packet/encrypted_key.go b/libgo/go/crypto/openpgp/packet/encrypted_key.go index d05103fcd82..b24fa3a3fd3 100644 --- a/libgo/go/crypto/openpgp/packet/encrypted_key.go +++ b/libgo/go/crypto/openpgp/packet/encrypted_key.go @@ -5,13 +5,13 @@ package packet import ( - "big" "crypto/openpgp/elgamal" error_ "crypto/openpgp/error" "crypto/rand" "crypto/rsa" "encoding/binary" "io" + "math/big" "strconv" ) diff --git a/libgo/go/crypto/openpgp/packet/encrypted_key_test.go b/libgo/go/crypto/openpgp/packet/encrypted_key_test.go index b402245bdae..2b8eff7b3a9 100644 --- a/libgo/go/crypto/openpgp/packet/encrypted_key_test.go +++ b/libgo/go/crypto/openpgp/packet/encrypted_key_test.go @@ -5,11 +5,11 @@ package packet import ( - "big" "bytes" "crypto/rand" "crypto/rsa" "fmt" + "math/big" "testing" ) diff --git a/libgo/go/crypto/openpgp/packet/packet.go b/libgo/go/crypto/openpgp/packet/packet.go index f7ed3536c52..778df15c0bd 100644 --- a/libgo/go/crypto/openpgp/packet/packet.go +++ b/libgo/go/crypto/openpgp/packet/packet.go @@ -7,12 +7,12 @@ package packet import ( - "big" "crypto/aes" "crypto/cast5" "crypto/cipher" error_ "crypto/openpgp/error" "io" + "math/big" ) // readFull is the same as io.ReadFull except that reading zero bytes returns diff --git a/libgo/go/crypto/openpgp/packet/private_key.go b/libgo/go/crypto/openpgp/packet/private_key.go index 742ac51e6e3..c0ff82b4135 100644 --- a/libgo/go/crypto/openpgp/packet/private_key.go +++ b/libgo/go/crypto/openpgp/packet/private_key.go @@ -5,7 +5,6 @@ package packet import ( - "big" "bytes" "crypto/cipher" "crypto/dsa" @@ -16,6 +15,7 @@ import ( "crypto/sha1" "io" "io/ioutil" + "math/big" "strconv" ) diff --git a/libgo/go/crypto/openpgp/packet/public_key.go b/libgo/go/crypto/openpgp/packet/public_key.go index af0bc2273f8..7d71dc49a7b 100644 --- a/libgo/go/crypto/openpgp/packet/public_key.go +++ b/libgo/go/crypto/openpgp/packet/public_key.go @@ -5,7 +5,6 @@ package packet import ( - "big" "crypto/dsa" "crypto/openpgp/elgamal" error_ "crypto/openpgp/error" @@ -15,6 +14,7 @@ import ( "fmt" "hash" "io" + "math/big" "strconv" ) diff --git a/libgo/go/crypto/openpgp/s2k/s2k_test.go b/libgo/go/crypto/openpgp/s2k/s2k_test.go index ec4012c2384..3a094a10f1f 100644 --- a/libgo/go/crypto/openpgp/s2k/s2k_test.go +++ b/libgo/go/crypto/openpgp/s2k/s2k_test.go @@ -6,8 +6,8 @@ package s2k import ( "bytes" - "crypto/sha1" "crypto/rand" + "crypto/sha1" "encoding/hex" "testing" ) diff --git a/libgo/go/crypto/rand/util.go b/libgo/go/crypto/rand/util.go index 322da4aed40..b44ae9897ba 100644 --- a/libgo/go/crypto/rand/util.go +++ b/libgo/go/crypto/rand/util.go @@ -5,8 +5,8 @@ package rand import ( - "big" "io" + "math/big" "os" ) diff --git a/libgo/go/crypto/rsa/pkcs1v15.go b/libgo/go/crypto/rsa/pkcs1v15.go index 901539df174..d7b053fec5c 100644 --- a/libgo/go/crypto/rsa/pkcs1v15.go +++ b/libgo/go/crypto/rsa/pkcs1v15.go @@ -5,11 +5,11 @@ package rsa import ( - "big" "crypto" "crypto/subtle" "errors" "io" + "math/big" ) // This file implements encryption and decryption using PKCS#1 v1.5 padding. diff --git a/libgo/go/crypto/rsa/pkcs1v15_test.go b/libgo/go/crypto/rsa/pkcs1v15_test.go index d69bacfd685..66188ac10ed 100644 --- a/libgo/go/crypto/rsa/pkcs1v15_test.go +++ b/libgo/go/crypto/rsa/pkcs1v15_test.go @@ -5,7 +5,6 @@ package rsa import ( - "big" "bytes" "crypto" "crypto/rand" @@ -13,6 +12,7 @@ import ( "encoding/base64" "encoding/hex" "io" + "math/big" "testing" "testing/quick" ) diff --git a/libgo/go/crypto/rsa/rsa.go b/libgo/go/crypto/rsa/rsa.go index c9344ffadff..27ccf61c4fc 100644 --- a/libgo/go/crypto/rsa/rsa.go +++ b/libgo/go/crypto/rsa/rsa.go @@ -8,12 +8,12 @@ package rsa // TODO(agl): Add support for PSS padding. import ( - "big" "crypto/rand" "crypto/subtle" "errors" "hash" "io" + "math/big" ) var bigZero = big.NewInt(0) diff --git a/libgo/go/crypto/rsa/rsa_test.go b/libgo/go/crypto/rsa/rsa_test.go index c36bca1cd37..0fb9875d044 100644 --- a/libgo/go/crypto/rsa/rsa_test.go +++ b/libgo/go/crypto/rsa/rsa_test.go @@ -5,10 +5,10 @@ package rsa import ( - "big" "bytes" "crypto/rand" "crypto/sha1" + "math/big" "testing" ) diff --git a/libgo/go/crypto/tls/conn.go b/libgo/go/crypto/tls/conn.go index 6312c34d6d7..f4178e30c58 100644 --- a/libgo/go/crypto/tls/conn.go +++ b/libgo/go/crypto/tls/conn.go @@ -471,7 +471,7 @@ Again: // RFC suggests that EOF without an alertCloseNotify is // an error, but popular web sites seem to do this, // so we can't make it an error. - // if err == os.EOF { + // if err == io.EOF { // err = io.ErrUnexpectedEOF // } if e, ok := err.(net.Error); !ok || !e.Temporary() { diff --git a/libgo/go/crypto/tls/generate_cert.go b/libgo/go/crypto/tls/generate_cert.go index 41206e276b3..c4463ff48f8 100644 --- a/libgo/go/crypto/tls/generate_cert.go +++ b/libgo/go/crypto/tls/generate_cert.go @@ -8,14 +8,14 @@ package main import ( - "big" - "crypto/x509/pkix" "crypto/rand" "crypto/rsa" "crypto/x509" + "crypto/x509/pkix" "encoding/pem" "flag" "log" + "math/big" "os" "time" ) diff --git a/libgo/go/crypto/tls/handshake_messages_test.go b/libgo/go/crypto/tls/handshake_messages_test.go index dc68a12239a..87e8f7e428d 100644 --- a/libgo/go/crypto/tls/handshake_messages_test.go +++ b/libgo/go/crypto/tls/handshake_messages_test.go @@ -5,7 +5,7 @@ package tls import ( - "rand" + "math/rand" "reflect" "testing" "testing/quick" diff --git a/libgo/go/crypto/tls/handshake_server_test.go b/libgo/go/crypto/tls/handshake_server_test.go index f2b0a144e5e..bc3797947f5 100644 --- a/libgo/go/crypto/tls/handshake_server_test.go +++ b/libgo/go/crypto/tls/handshake_server_test.go @@ -5,12 +5,12 @@ package tls import ( - "big" "bytes" "crypto/rsa" "encoding/hex" "flag" "io" + "math/big" "net" "strconv" "strings" diff --git a/libgo/go/crypto/tls/key_agreement.go b/libgo/go/crypto/tls/key_agreement.go index ba34606eea2..08fb852d66a 100644 --- a/libgo/go/crypto/tls/key_agreement.go +++ b/libgo/go/crypto/tls/key_agreement.go @@ -5,7 +5,6 @@ package tls import ( - "big" "crypto" "crypto/elliptic" "crypto/md5" @@ -14,6 +13,7 @@ import ( "crypto/x509" "errors" "io" + "math/big" ) // rsaKeyAgreement implements the standard TLS key agreement where the client diff --git a/libgo/go/crypto/x509/pkcs1.go b/libgo/go/crypto/x509/pkcs1.go index 0d3ade37578..31d0dd0c226 100644 --- a/libgo/go/crypto/x509/pkcs1.go +++ b/libgo/go/crypto/x509/pkcs1.go @@ -5,10 +5,10 @@ package x509 import ( - "asn1" - "big" - "errors" "crypto/rsa" + "encoding/asn1" + "errors" + "math/big" ) // pkcs1PrivateKey is a structure which mirrors the PKCS#1 ASN.1 for an RSA private key. diff --git a/libgo/go/crypto/x509/pkix/pkix.go b/libgo/go/crypto/x509/pkix/pkix.go index 332a3946212..b35274c9ae1 100644 --- a/libgo/go/crypto/x509/pkix/pkix.go +++ b/libgo/go/crypto/x509/pkix/pkix.go @@ -7,8 +7,8 @@ package pkix import ( - "asn1" - "big" + "encoding/asn1" + "math/big" "time" ) diff --git a/libgo/go/crypto/x509/x509.go b/libgo/go/crypto/x509/x509.go index da8b28337eb..9ff7db9a0f9 100644 --- a/libgo/go/crypto/x509/x509.go +++ b/libgo/go/crypto/x509/x509.go @@ -6,17 +6,17 @@ package x509 import ( - "asn1" - "big" "bytes" "crypto" "crypto/dsa" "crypto/rsa" "crypto/sha1" "crypto/x509/pkix" + "encoding/asn1" "encoding/pem" "errors" "io" + "math/big" "time" ) diff --git a/libgo/go/crypto/x509/x509_test.go b/libgo/go/crypto/x509/x509_test.go index d113f850eb0..c42471507be 100644 --- a/libgo/go/crypto/x509/x509_test.go +++ b/libgo/go/crypto/x509/x509_test.go @@ -5,16 +5,16 @@ package x509 import ( - "asn1" - "big" "bytes" "crypto/dsa" "crypto/rand" "crypto/rsa" "crypto/x509/pkix" + "encoding/asn1" "encoding/base64" "encoding/hex" "encoding/pem" + "math/big" "testing" "time" ) diff --git a/libgo/go/debug/gosym/pclntab_test.go b/libgo/go/debug/gosym/pclntab_test.go index c83e64eabd7..562e7a0a37f 100644 --- a/libgo/go/debug/gosym/pclntab_test.go +++ b/libgo/go/debug/gosym/pclntab_test.go @@ -7,8 +7,8 @@ package gosym import ( "debug/elf" "os" - "testing" "syscall" + "testing" ) func dotest() bool { diff --git a/libgo/go/asn1/asn1.go b/libgo/go/encoding/asn1/asn1.go similarity index 99% rename from libgo/go/asn1/asn1.go rename to libgo/go/encoding/asn1/asn1.go index 73e733e3659..a0066654f8d 100644 --- a/libgo/go/asn1/asn1.go +++ b/libgo/go/encoding/asn1/asn1.go @@ -20,8 +20,8 @@ package asn1 // everything by any means. import ( - "big" "fmt" + "math/big" "reflect" "time" ) diff --git a/libgo/go/asn1/asn1_test.go b/libgo/go/encoding/asn1/asn1_test.go similarity index 100% rename from libgo/go/asn1/asn1_test.go rename to libgo/go/encoding/asn1/asn1_test.go diff --git a/libgo/go/asn1/common.go b/libgo/go/encoding/asn1/common.go similarity index 100% rename from libgo/go/asn1/common.go rename to libgo/go/encoding/asn1/common.go diff --git a/libgo/go/asn1/marshal.go b/libgo/go/encoding/asn1/marshal.go similarity index 99% rename from libgo/go/asn1/marshal.go rename to libgo/go/encoding/asn1/marshal.go index 583d0104711..89c50a70ef4 100644 --- a/libgo/go/asn1/marshal.go +++ b/libgo/go/encoding/asn1/marshal.go @@ -5,10 +5,10 @@ package asn1 import ( - "big" "bytes" "fmt" "io" + "math/big" "reflect" "time" ) diff --git a/libgo/go/asn1/marshal_test.go b/libgo/go/encoding/asn1/marshal_test.go similarity index 100% rename from libgo/go/asn1/marshal_test.go rename to libgo/go/encoding/asn1/marshal_test.go diff --git a/libgo/go/encoding/binary/binary.go b/libgo/go/encoding/binary/binary.go index 65b9f013fcd..d2f8b1e6248 100644 --- a/libgo/go/encoding/binary/binary.go +++ b/libgo/go/encoding/binary/binary.go @@ -9,8 +9,8 @@ package binary import ( "errors" - "math" "io" + "math" "reflect" ) diff --git a/libgo/go/encoding/binary/binary_test.go b/libgo/go/encoding/binary/binary_test.go index e753aa0b5b6..fd4fdb01574 100644 --- a/libgo/go/encoding/binary/binary_test.go +++ b/libgo/go/encoding/binary/binary_test.go @@ -7,7 +7,6 @@ package binary import ( "bytes" "io" - "bytes" "math" "reflect" "testing" diff --git a/libgo/go/csv/reader.go b/libgo/go/encoding/csv/reader.go similarity index 100% rename from libgo/go/csv/reader.go rename to libgo/go/encoding/csv/reader.go diff --git a/libgo/go/csv/reader_test.go b/libgo/go/encoding/csv/reader_test.go similarity index 100% rename from libgo/go/csv/reader_test.go rename to libgo/go/encoding/csv/reader_test.go diff --git a/libgo/go/csv/writer.go b/libgo/go/encoding/csv/writer.go similarity index 99% rename from libgo/go/csv/writer.go rename to libgo/go/encoding/csv/writer.go index 5ea20e100e8..c4dcba5668a 100644 --- a/libgo/go/csv/writer.go +++ b/libgo/go/encoding/csv/writer.go @@ -9,7 +9,7 @@ import ( "io" "strings" "unicode" - "utf8" + "unicode/utf8" ) // A Writer writes records to a CSV encoded file. diff --git a/libgo/go/csv/writer_test.go b/libgo/go/encoding/csv/writer_test.go similarity index 100% rename from libgo/go/csv/writer_test.go rename to libgo/go/encoding/csv/writer_test.go diff --git a/libgo/go/gob/codec_test.go b/libgo/go/encoding/gob/codec_test.go similarity index 100% rename from libgo/go/gob/codec_test.go rename to libgo/go/encoding/gob/codec_test.go diff --git a/libgo/go/encoding/gob/debug.go b/libgo/go/encoding/gob/debug.go new file mode 100644 index 00000000000..b21c7fa0b2b --- /dev/null +++ b/libgo/go/encoding/gob/debug.go @@ -0,0 +1,687 @@ +package gob + +// This file is not normally included in the gob package. Used only for debugging the package itself. +// Add debug.go to the files listed in the Makefile to add Debug to the gob package. +// Except for reading uints, it is an implementation of a reader that is independent of +// the one implemented by Decoder. + +import ( + "bytes" + "fmt" + "io" + "os" + "strings" + "sync" +) + +var dumpBytes = false // If true, print the remaining bytes in the input buffer at each item. + +// Init installs the debugging facility. If this file is not compiled in the +// package, the tests in codec_test.go are no-ops. +func init() { + debugFunc = Debug +} + +var ( + blanks = bytes.Repeat([]byte{' '}, 3*10) + empty = []byte(": \n") + tabs = strings.Repeat("\t", 100) +) + +// tab indents itself when printed. +type tab int + +func (t tab) String() string { + n := int(t) + if n > len(tabs) { + n = len(tabs) + } + return tabs[0:n] +} + +func (t tab) print() { + fmt.Fprint(os.Stderr, t) +} + +// A peekReader wraps an io.Reader, allowing one to peek ahead to see +// what's coming without stealing the data from the client of the Reader. +type peekReader struct { + r io.Reader + data []byte // read-ahead data +} + +// newPeekReader returns a peekReader that wraps r. +func newPeekReader(r io.Reader) *peekReader { + return &peekReader{r: r} +} + +// Read is the usual method. It will first take data that has been read ahead. +func (p *peekReader) Read(b []byte) (n int, err error) { + if len(p.data) == 0 { + return p.r.Read(b) + } + // Satisfy what's possible from the read-ahead data. + n = copy(b, p.data) + // Move data down to beginning of slice, to avoid endless growth + copy(p.data, p.data[n:]) + p.data = p.data[:len(p.data)-n] + return +} + +// peek returns as many bytes as possible from the unread +// portion of the stream, up to the length of b. +func (p *peekReader) peek(b []byte) (n int, err error) { + if len(p.data) > 0 { + n = copy(b, p.data) + if n == len(b) { + return + } + b = b[n:] + } + if len(b) == 0 { + return + } + m, e := io.ReadFull(p.r, b) + if m > 0 { + p.data = append(p.data, b[:m]...) + } + n += m + if e == io.ErrUnexpectedEOF { + // That means m > 0 but we reached EOF. If we got data + // we won't complain about not being able to peek enough. + if n > 0 { + e = nil + } else { + e = io.EOF + } + } + return n, e +} + +type debugger struct { + mutex sync.Mutex + remain int // the number of bytes known to remain in the input + remainingKnown bool // the value of 'remain' is valid + r *peekReader + wireType map[typeId]*wireType + tmp []byte // scratch space for decoding uints. +} + +// dump prints the next nBytes of the input. +// It arranges to print the output aligned from call to +// call, to make it easy to see what has been consumed. +func (deb *debugger) dump(format string, args ...interface{}) { + if !dumpBytes { + return + } + fmt.Fprintf(os.Stderr, format+" ", args...) + if !deb.remainingKnown { + return + } + if deb.remain < 0 { + fmt.Fprintf(os.Stderr, "remaining byte count is negative! %d\n", deb.remain) + return + } + data := make([]byte, deb.remain) + n, _ := deb.r.peek(data) + if n == 0 { + os.Stderr.Write(empty) + return + } + b := new(bytes.Buffer) + fmt.Fprintf(b, "[%d]{\n", deb.remain) + // Blanks until first byte + lineLength := 0 + if n := len(data); n%10 != 0 { + lineLength = 10 - n%10 + fmt.Fprintf(b, "\t%s", blanks[:lineLength*3]) + } + // 10 bytes per line + for len(data) > 0 { + if lineLength == 0 { + fmt.Fprint(b, "\t") + } + m := 10 - lineLength + lineLength = 0 + if m > len(data) { + m = len(data) + } + fmt.Fprintf(b, "% x\n", data[:m]) + data = data[m:] + } + fmt.Fprint(b, "}\n") + os.Stderr.Write(b.Bytes()) +} + +// Debug prints a human-readable representation of the gob data read from r. +// It is a no-op unless debugging was enabled when the package was built. +func Debug(r io.Reader) { + err := debug(r) + if err != nil { + fmt.Fprintf(os.Stderr, "gob debug: %s\n", err) + } +} + +// debug implements Debug, but catches panics and returns +// them as errors to be printed by Debug. +func debug(r io.Reader) (err error) { + defer catchError(&err) + fmt.Fprintln(os.Stderr, "Start of debugging") + deb := &debugger{ + r: newPeekReader(r), + wireType: make(map[typeId]*wireType), + tmp: make([]byte, 16), + } + if b, ok := r.(*bytes.Buffer); ok { + deb.remain = b.Len() + deb.remainingKnown = true + } + deb.gobStream() + return +} + +// note that we've consumed some bytes +func (deb *debugger) consumed(n int) { + if deb.remainingKnown { + deb.remain -= n + } +} + +// int64 decodes and returns the next integer, which must be present. +// Don't call this if you could be at EOF. +func (deb *debugger) int64() int64 { + return toInt(deb.uint64()) +} + +// uint64 returns and decodes the next unsigned integer, which must be present. +// Don't call this if you could be at EOF. +// TODO: handle errors better. +func (deb *debugger) uint64() uint64 { + n, w, err := decodeUintReader(deb.r, deb.tmp) + if err != nil { + errorf("debug: read error: %s", err) + } + deb.consumed(w) + return n +} + +// GobStream: +// DelimitedMessage* (until EOF) +func (deb *debugger) gobStream() { + // Make sure we're single-threaded through here. + deb.mutex.Lock() + defer deb.mutex.Unlock() + + for deb.delimitedMessage(0) { + } +} + +// DelimitedMessage: +// uint(lengthOfMessage) Message +func (deb *debugger) delimitedMessage(indent tab) bool { + for { + n := deb.loadBlock(true) + if n < 0 { + return false + } + deb.dump("Delimited message of length %d", n) + deb.message(indent) + } + return true +} + +// loadBlock preps us to read a message +// of the length specified next in the input. It returns +// the length of the block. The argument tells whether +// an EOF is acceptable now. If it is and one is found, +// the return value is negative. +func (deb *debugger) loadBlock(eofOK bool) int { + n64, w, err := decodeUintReader(deb.r, deb.tmp) // deb.uint64 will error at EOF + if err != nil { + if eofOK && err == io.EOF { + return -1 + } + errorf("debug: unexpected error: %s", err) + } + deb.consumed(w) + n := int(n64) + if n < 0 { + errorf("huge value for message length: %d", n64) + } + return int(n) +} + +// Message: +// TypeSequence TypedValue +// TypeSequence +// (TypeDefinition DelimitedTypeDefinition*)? +// DelimitedTypeDefinition: +// uint(lengthOfTypeDefinition) TypeDefinition +// TypedValue: +// int(typeId) Value +func (deb *debugger) message(indent tab) bool { + for { + // Convert the uint64 to a signed integer typeId + uid := deb.int64() + id := typeId(uid) + deb.dump("type id=%d", id) + if id < 0 { + deb.typeDefinition(indent, -id) + n := deb.loadBlock(false) + deb.dump("Message of length %d", n) + continue + } else { + deb.value(indent, id) + break + } + } + return true +} + +// Helper methods to make it easy to scan a type descriptor. + +// common returns the CommonType at the input point. +func (deb *debugger) common() CommonType { + fieldNum := -1 + name := "" + id := typeId(0) + for { + delta := deb.delta(-1) + if delta == 0 { + break + } + fieldNum += delta + switch fieldNum { + case 0: + name = deb.string() + case 1: + // Id typeId + id = deb.typeId() + default: + errorf("corrupted CommonType") + } + } + return CommonType{name, id} +} + +// uint returns the unsigned int at the input point, as a uint (not uint64). +func (deb *debugger) uint() uint { + return uint(deb.uint64()) +} + +// int returns the signed int at the input point, as an int (not int64). +func (deb *debugger) int() int { + return int(deb.int64()) +} + +// typeId returns the type id at the input point. +func (deb *debugger) typeId() typeId { + return typeId(deb.int64()) +} + +// string returns the string at the input point. +func (deb *debugger) string() string { + x := int(deb.uint64()) + b := make([]byte, x) + nb, _ := deb.r.Read(b) + if nb != x { + errorf("corrupted type") + } + deb.consumed(nb) + return string(b) +} + +// delta returns the field delta at the input point. The expect argument, +// if non-negative, identifies what the value should be. +func (deb *debugger) delta(expect int) int { + delta := int(deb.uint64()) + if delta < 0 || (expect >= 0 && delta != expect) { + errorf("decode: corrupted type: delta %d expected %d", delta, expect) + } + return delta +} + +// TypeDefinition: +// [int(-typeId) (already read)] encodingOfWireType +func (deb *debugger) typeDefinition(indent tab, id typeId) { + deb.dump("type definition for id %d", id) + // Encoding is of a wireType. Decode the structure as usual + fieldNum := -1 + wire := new(wireType) + // A wireType defines a single field. + delta := deb.delta(-1) + fieldNum += delta + switch fieldNum { + case 0: // array type, one field of {{Common}, elem, length} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + // Field number 1 is type Id of elem + deb.delta(1) + id := deb.typeId() + // Field number 3 is length + deb.delta(1) + length := deb.int() + wire.ArrayT = &arrayType{com, id, length} + + case 1: // slice type, one field of {{Common}, elem} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + // Field number 1 is type Id of elem + deb.delta(1) + id := deb.typeId() + wire.SliceT = &sliceType{com, id} + + case 2: // struct type, one field of {{Common}, []fieldType} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + // Field number 1 is slice of FieldType + deb.delta(1) + numField := int(deb.uint()) + field := make([]*fieldType, numField) + for i := 0; i < numField; i++ { + field[i] = new(fieldType) + deb.delta(1) // field 0 of fieldType: name + field[i].Name = deb.string() + deb.delta(1) // field 1 of fieldType: id + field[i].Id = deb.typeId() + deb.delta(0) // end of fieldType + } + wire.StructT = &structType{com, field} + + case 3: // map type, one field of {{Common}, key, elem} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + // Field number 1 is type Id of key + deb.delta(1) + keyId := deb.typeId() + // Field number 2 is type Id of elem + deb.delta(1) + elemId := deb.typeId() + wire.MapT = &mapType{com, keyId, elemId} + case 4: // GobEncoder type, one field of {{Common}} + // Field number 0 is CommonType + deb.delta(1) + com := deb.common() + wire.GobEncoderT = &gobEncoderType{com} + default: + errorf("bad field in type %d", fieldNum) + } + deb.printWireType(indent, wire) + deb.delta(0) // end inner type (arrayType, etc.) + deb.delta(0) // end wireType + // Remember we've seen this type. + deb.wireType[id] = wire +} + +// Value: +// SingletonValue | StructValue +func (deb *debugger) value(indent tab, id typeId) { + wire, ok := deb.wireType[id] + if ok && wire.StructT != nil { + deb.structValue(indent, id) + } else { + deb.singletonValue(indent, id) + } +} + +// SingletonValue: +// uint(0) FieldValue +func (deb *debugger) singletonValue(indent tab, id typeId) { + deb.dump("Singleton value") + // is it a builtin type? + wire := deb.wireType[id] + _, ok := builtinIdToType[id] + if !ok && wire == nil { + errorf("type id %d not defined", id) + } + m := deb.uint64() + if m != 0 { + errorf("expected zero; got %d", m) + } + deb.fieldValue(indent, id) +} + +// InterfaceValue: +// NilInterfaceValue | NonNilInterfaceValue +func (deb *debugger) interfaceValue(indent tab) { + deb.dump("Start of interface value") + if nameLen := deb.uint64(); nameLen == 0 { + deb.nilInterfaceValue(indent) + } else { + deb.nonNilInterfaceValue(indent, int(nameLen)) + } +} + +// NilInterfaceValue: +// uint(0) [already read] +func (deb *debugger) nilInterfaceValue(indent tab) int { + fmt.Fprintf(os.Stderr, "%snil interface\n", indent) + return 0 +} + +// NonNilInterfaceValue: +// ConcreteTypeName TypeSequence InterfaceContents +// ConcreteTypeName: +// uint(lengthOfName) [already read=n] name +// InterfaceContents: +// int(concreteTypeId) DelimitedValue +// DelimitedValue: +// uint(length) Value +func (deb *debugger) nonNilInterfaceValue(indent tab, nameLen int) { + // ConcreteTypeName + b := make([]byte, nameLen) + deb.r.Read(b) // TODO: CHECK THESE READS!! + deb.consumed(nameLen) + name := string(b) + + for { + id := deb.typeId() + if id < 0 { + deb.typeDefinition(indent, -id) + n := deb.loadBlock(false) + deb.dump("Nested message of length %d", n) + } else { + // DelimitedValue + x := deb.uint64() // in case we want to ignore the value; we don't. + fmt.Fprintf(os.Stderr, "%sinterface value, type %q id=%d; valueLength %d\n", indent, name, id, x) + deb.value(indent, id) + break + } + } +} + +// printCommonType prints a common type; used by printWireType. +func (deb *debugger) printCommonType(indent tab, kind string, common *CommonType) { + indent.print() + fmt.Fprintf(os.Stderr, "%s %q id=%d\n", kind, common.Name, common.Id) +} + +// printWireType prints the contents of a wireType. +func (deb *debugger) printWireType(indent tab, wire *wireType) { + fmt.Fprintf(os.Stderr, "%stype definition {\n", indent) + indent++ + switch { + case wire.ArrayT != nil: + deb.printCommonType(indent, "array", &wire.ArrayT.CommonType) + fmt.Fprintf(os.Stderr, "%slen %d\n", indent+1, wire.ArrayT.Len) + fmt.Fprintf(os.Stderr, "%selemid %d\n", indent+1, wire.ArrayT.Elem) + case wire.MapT != nil: + deb.printCommonType(indent, "map", &wire.MapT.CommonType) + fmt.Fprintf(os.Stderr, "%skey id=%d\n", indent+1, wire.MapT.Key) + fmt.Fprintf(os.Stderr, "%selem id=%d\n", indent+1, wire.MapT.Elem) + case wire.SliceT != nil: + deb.printCommonType(indent, "slice", &wire.SliceT.CommonType) + fmt.Fprintf(os.Stderr, "%selem id=%d\n", indent+1, wire.SliceT.Elem) + case wire.StructT != nil: + deb.printCommonType(indent, "struct", &wire.StructT.CommonType) + for i, field := range wire.StructT.Field { + fmt.Fprintf(os.Stderr, "%sfield %d:\t%s\tid=%d\n", indent+1, i, field.Name, field.Id) + } + case wire.GobEncoderT != nil: + deb.printCommonType(indent, "GobEncoder", &wire.GobEncoderT.CommonType) + } + indent-- + fmt.Fprintf(os.Stderr, "%s}\n", indent) +} + +// fieldValue prints a value of any type, such as a struct field. +// FieldValue: +// builtinValue | ArrayValue | MapValue | SliceValue | StructValue | InterfaceValue +func (deb *debugger) fieldValue(indent tab, id typeId) { + _, ok := builtinIdToType[id] + if ok { + if id == tInterface { + deb.interfaceValue(indent) + } else { + deb.printBuiltin(indent, id) + } + return + } + wire, ok := deb.wireType[id] + if !ok { + errorf("type id %d not defined", id) + } + switch { + case wire.ArrayT != nil: + deb.arrayValue(indent, wire) + case wire.MapT != nil: + deb.mapValue(indent, wire) + case wire.SliceT != nil: + deb.sliceValue(indent, wire) + case wire.StructT != nil: + deb.structValue(indent, id) + case wire.GobEncoderT != nil: + deb.gobEncoderValue(indent, id) + default: + panic("bad wire type for field") + } +} + +// printBuiltin prints a value not of a fundamental type, that is, +// one whose type is known to gobs at bootstrap time. +func (deb *debugger) printBuiltin(indent tab, id typeId) { + switch id { + case tBool: + x := deb.int64() + if x == 0 { + fmt.Fprintf(os.Stderr, "%sfalse\n", indent) + } else { + fmt.Fprintf(os.Stderr, "%strue\n", indent) + } + case tInt: + x := deb.int64() + fmt.Fprintf(os.Stderr, "%s%d\n", indent, x) + case tUint: + x := deb.int64() + fmt.Fprintf(os.Stderr, "%s%d\n", indent, x) + case tFloat: + x := deb.uint64() + fmt.Fprintf(os.Stderr, "%s%g\n", indent, floatFromBits(x)) + case tComplex: + r := deb.uint64() + i := deb.uint64() + fmt.Fprintf(os.Stderr, "%s%g+%gi\n", indent, floatFromBits(r), floatFromBits(i)) + case tBytes: + x := int(deb.uint64()) + b := make([]byte, x) + deb.r.Read(b) + deb.consumed(x) + fmt.Fprintf(os.Stderr, "%s{% x}=%q\n", indent, b, b) + case tString: + x := int(deb.uint64()) + b := make([]byte, x) + deb.r.Read(b) + deb.consumed(x) + fmt.Fprintf(os.Stderr, "%s%q\n", indent, b) + default: + panic("unknown builtin") + } +} + +// ArrayValue: +// uint(n) FieldValue*n +func (deb *debugger) arrayValue(indent tab, wire *wireType) { + elemId := wire.ArrayT.Elem + u := deb.uint64() + length := int(u) + for i := 0; i < length; i++ { + deb.fieldValue(indent, elemId) + } + if length != wire.ArrayT.Len { + fmt.Fprintf(os.Stderr, "%s(wrong length for array: %d should be %d)\n", indent, length, wire.ArrayT.Len) + } +} + +// MapValue: +// uint(n) (FieldValue FieldValue)*n [n (key, value) pairs] +func (deb *debugger) mapValue(indent tab, wire *wireType) { + keyId := wire.MapT.Key + elemId := wire.MapT.Elem + u := deb.uint64() + length := int(u) + for i := 0; i < length; i++ { + deb.fieldValue(indent+1, keyId) + deb.fieldValue(indent+1, elemId) + } +} + +// SliceValue: +// uint(n) (n FieldValue) +func (deb *debugger) sliceValue(indent tab, wire *wireType) { + elemId := wire.SliceT.Elem + u := deb.uint64() + length := int(u) + deb.dump("Start of slice of length %d", length) + + for i := 0; i < length; i++ { + deb.fieldValue(indent, elemId) + } +} + +// StructValue: +// (uint(fieldDelta) FieldValue)* +func (deb *debugger) structValue(indent tab, id typeId) { + deb.dump("Start of struct value of %q id=%d\n<<\n", id.name(), id) + fmt.Fprintf(os.Stderr, "%s%s struct {\n", indent, id.name()) + wire, ok := deb.wireType[id] + if !ok { + errorf("type id %d not defined", id) + } + strct := wire.StructT + fieldNum := -1 + indent++ + for { + delta := deb.uint64() + if delta == 0 { // struct terminator is zero delta fieldnum + break + } + fieldNum += int(delta) + if fieldNum < 0 || fieldNum >= len(strct.Field) { + deb.dump("field number out of range: prevField=%d delta=%d", fieldNum-int(delta), delta) + break + } + fmt.Fprintf(os.Stderr, "%sfield %d:\t%s\n", indent, fieldNum, wire.StructT.Field[fieldNum].Name) + deb.fieldValue(indent+1, strct.Field[fieldNum].Id) + } + indent-- + fmt.Fprintf(os.Stderr, "%s} // end %s struct\n", indent, id.name()) + deb.dump(">> End of struct value of type %d %q", id, id.name()) +} + +// GobEncoderValue: +// uint(n) byte*n +func (deb *debugger) gobEncoderValue(indent tab, id typeId) { + len := deb.uint64() + deb.dump("GobEncoder value of %q id=%d, length %d\n", id.name(), id, len) + fmt.Fprintf(os.Stderr, "%s%s (implements GobEncoder)\n", indent, id.name()) + data := make([]byte, len) + _, err := deb.r.Read(data) + if err != nil { + errorf("gobEncoder data read: %s", err) + } + fmt.Fprintf(os.Stderr, "%s[% .2x]\n", indent+1, data) +} diff --git a/libgo/go/gob/decode.go b/libgo/go/encoding/gob/decode.go similarity index 100% rename from libgo/go/gob/decode.go rename to libgo/go/encoding/gob/decode.go diff --git a/libgo/go/gob/decoder.go b/libgo/go/encoding/gob/decoder.go similarity index 100% rename from libgo/go/gob/decoder.go rename to libgo/go/encoding/gob/decoder.go diff --git a/libgo/go/gob/doc.go b/libgo/go/encoding/gob/doc.go similarity index 100% rename from libgo/go/gob/doc.go rename to libgo/go/encoding/gob/doc.go diff --git a/libgo/go/encoding/gob/dump.go b/libgo/go/encoding/gob/dump.go new file mode 100644 index 00000000000..0d0017cc783 --- /dev/null +++ b/libgo/go/encoding/gob/dump.go @@ -0,0 +1,22 @@ +package main + +// Need to compile package gob with debug.go to build this program. + +import ( + "encoding/gob" + "fmt" + "os" +) + +func main() { + var err error + file := os.Stdin + if len(os.Args) > 1 { + file, err = os.Open(os.Args[1]) + if err != nil { + fmt.Fprintf(os.Stderr, "dump: %s\n", err) + os.Exit(1) + } + } + gob.Debug(file) +} diff --git a/libgo/go/gob/encode.go b/libgo/go/encoding/gob/encode.go similarity index 100% rename from libgo/go/gob/encode.go rename to libgo/go/encoding/gob/encode.go diff --git a/libgo/go/gob/encoder.go b/libgo/go/encoding/gob/encoder.go similarity index 100% rename from libgo/go/gob/encoder.go rename to libgo/go/encoding/gob/encoder.go diff --git a/libgo/go/gob/encoder_test.go b/libgo/go/encoding/gob/encoder_test.go similarity index 100% rename from libgo/go/gob/encoder_test.go rename to libgo/go/encoding/gob/encoder_test.go diff --git a/libgo/go/gob/error.go b/libgo/go/encoding/gob/error.go similarity index 100% rename from libgo/go/gob/error.go rename to libgo/go/encoding/gob/error.go diff --git a/libgo/go/gob/gobencdec_test.go b/libgo/go/encoding/gob/gobencdec_test.go similarity index 100% rename from libgo/go/gob/gobencdec_test.go rename to libgo/go/encoding/gob/gobencdec_test.go diff --git a/libgo/go/gob/timing_test.go b/libgo/go/encoding/gob/timing_test.go similarity index 100% rename from libgo/go/gob/timing_test.go rename to libgo/go/encoding/gob/timing_test.go diff --git a/libgo/go/gob/type.go b/libgo/go/encoding/gob/type.go similarity index 97% rename from libgo/go/gob/type.go rename to libgo/go/encoding/gob/type.go index c3bc7c7ffc4..1b20843fa25 100644 --- a/libgo/go/gob/type.go +++ b/libgo/go/encoding/gob/type.go @@ -11,7 +11,7 @@ import ( "reflect" "sync" "unicode" - "utf8" + "unicode/utf8" ) // userTypeInfo stores the information associated with a type the user has handed @@ -703,18 +703,19 @@ func RegisterName(name string, value interface{}) { // reserved for nil panic("attempt to register empty name") } - base := userType(reflect.TypeOf(value)).base - // Check for incompatible duplicates. - if t, ok := nameToConcreteType[name]; ok && t != base { - panic("gob: registering duplicate types for " + name) + ut := userType(reflect.TypeOf(value)) + // Check for incompatible duplicates. The name must refer to the + // same user type, and vice versa. + if t, ok := nameToConcreteType[name]; ok && t != ut.user { + panic(fmt.Sprintf("gob: registering duplicate types for %q: %s != %s", name, t, ut.user)) } - if n, ok := concreteTypeToName[base]; ok && n != name { - panic("gob: registering duplicate names for " + base.String()) + if n, ok := concreteTypeToName[ut.base]; ok && n != name { + panic(fmt.Sprintf("gob: registering duplicate names for %s: %q != %q", ut.user, n, name)) } // Store the name and type provided by the user.... nameToConcreteType[name] = reflect.TypeOf(value) // but the flattened type in the type table, since that's what decode needs. - concreteTypeToName[base] = name + concreteTypeToName[ut.base] = name } // Register records a type, identified by a value for that type, under its diff --git a/libgo/go/gob/type_test.go b/libgo/go/encoding/gob/type_test.go similarity index 95% rename from libgo/go/gob/type_test.go rename to libgo/go/encoding/gob/type_test.go index a6ac9c42010..42bdb4cf7bb 100644 --- a/libgo/go/gob/type_test.go +++ b/libgo/go/encoding/gob/type_test.go @@ -151,3 +151,11 @@ func TestStructType(t *testing.T) { t.Errorf("struct printed as %q; expected %q", str, expected) } } + +// Should be OK to register the same type multiple times, as long as they're +// at the same level of indirection. +func TestRegistration(t *testing.T) { + type T struct{ a int } + Register(new(T)) + Register(new(T)) +} diff --git a/libgo/go/json/decode.go b/libgo/go/encoding/json/decode.go similarity index 99% rename from libgo/go/json/decode.go rename to libgo/go/encoding/json/decode.go index 8abd7b4b4cb..41295d2d241 100644 --- a/libgo/go/json/decode.go +++ b/libgo/go/encoding/json/decode.go @@ -15,8 +15,8 @@ import ( "strconv" "strings" "unicode" - "utf16" - "utf8" + "unicode/utf16" + "unicode/utf8" ) // Unmarshal parses the JSON-encoded data and stores the result diff --git a/libgo/go/json/decode_test.go b/libgo/go/encoding/json/decode_test.go similarity index 100% rename from libgo/go/json/decode_test.go rename to libgo/go/encoding/json/decode_test.go diff --git a/libgo/go/json/encode.go b/libgo/go/encoding/json/encode.go similarity index 99% rename from libgo/go/json/encode.go rename to libgo/go/encoding/json/encode.go index aac8f91a447..35964c5d9c2 100644 --- a/libgo/go/json/encode.go +++ b/libgo/go/encoding/json/encode.go @@ -17,7 +17,7 @@ import ( "sort" "strconv" "unicode" - "utf8" + "unicode/utf8" ) // Marshal returns the JSON encoding of v. diff --git a/libgo/go/json/encode_test.go b/libgo/go/encoding/json/encode_test.go similarity index 100% rename from libgo/go/json/encode_test.go rename to libgo/go/encoding/json/encode_test.go diff --git a/libgo/go/json/indent.go b/libgo/go/encoding/json/indent.go similarity index 100% rename from libgo/go/json/indent.go rename to libgo/go/encoding/json/indent.go diff --git a/libgo/go/json/scanner.go b/libgo/go/encoding/json/scanner.go similarity index 100% rename from libgo/go/json/scanner.go rename to libgo/go/encoding/json/scanner.go diff --git a/libgo/go/json/scanner_test.go b/libgo/go/encoding/json/scanner_test.go similarity index 99% rename from libgo/go/json/scanner_test.go rename to libgo/go/encoding/json/scanner_test.go index 0b86cb537d2..a0a5995af8f 100644 --- a/libgo/go/json/scanner_test.go +++ b/libgo/go/encoding/json/scanner_test.go @@ -7,7 +7,7 @@ package json import ( "bytes" "math" - "rand" + "math/rand" "reflect" "testing" ) @@ -147,7 +147,7 @@ var indentErrorTests = []indentErrorTest{ {`{"X": "foo" "Y": "bar"}`, &SyntaxError{"invalid character '\"' after object key:value pair", 13}}, } -func TestIdentErrors(t *testing.T) { +func TestIndentErrors(t *testing.T) { for i, tt := range indentErrorTests { slice := make([]uint8, 0) buf := bytes.NewBuffer(slice) diff --git a/libgo/go/json/stream.go b/libgo/go/encoding/json/stream.go similarity index 100% rename from libgo/go/json/stream.go rename to libgo/go/encoding/json/stream.go diff --git a/libgo/go/json/stream_test.go b/libgo/go/encoding/json/stream_test.go similarity index 100% rename from libgo/go/json/stream_test.go rename to libgo/go/encoding/json/stream_test.go diff --git a/libgo/go/json/tagkey_test.go b/libgo/go/encoding/json/tagkey_test.go similarity index 100% rename from libgo/go/json/tagkey_test.go rename to libgo/go/encoding/json/tagkey_test.go diff --git a/libgo/go/json/tags.go b/libgo/go/encoding/json/tags.go similarity index 100% rename from libgo/go/json/tags.go rename to libgo/go/encoding/json/tags.go diff --git a/libgo/go/json/tags_test.go b/libgo/go/encoding/json/tags_test.go similarity index 100% rename from libgo/go/json/tags_test.go rename to libgo/go/encoding/json/tags_test.go diff --git a/libgo/go/xml/atom_test.go b/libgo/go/encoding/xml/atom_test.go similarity index 100% rename from libgo/go/xml/atom_test.go rename to libgo/go/encoding/xml/atom_test.go diff --git a/libgo/go/xml/embed_test.go b/libgo/go/encoding/xml/embed_test.go similarity index 100% rename from libgo/go/xml/embed_test.go rename to libgo/go/encoding/xml/embed_test.go diff --git a/libgo/go/xml/marshal.go b/libgo/go/encoding/xml/marshal.go similarity index 100% rename from libgo/go/xml/marshal.go rename to libgo/go/encoding/xml/marshal.go diff --git a/libgo/go/xml/marshal_test.go b/libgo/go/encoding/xml/marshal_test.go similarity index 100% rename from libgo/go/xml/marshal_test.go rename to libgo/go/encoding/xml/marshal_test.go index 59007b36456..a6f7d2d0c27 100644 --- a/libgo/go/xml/marshal_test.go +++ b/libgo/go/encoding/xml/marshal_test.go @@ -5,11 +5,11 @@ package xml import ( - "reflect" - "testing" "bytes" - "strings" + "reflect" "strconv" + "strings" + "testing" ) type DriveType int diff --git a/libgo/go/xml/read.go b/libgo/go/encoding/xml/read.go similarity index 99% rename from libgo/go/xml/read.go rename to libgo/go/encoding/xml/read.go index a88941c92b3..c6a3d75a801 100644 --- a/libgo/go/xml/read.go +++ b/libgo/go/encoding/xml/read.go @@ -13,7 +13,7 @@ import ( "strconv" "strings" "unicode" - "utf8" + "unicode/utf8" ) // BUG(rsc): Mapping between XML elements and data structures is inherently flawed: @@ -201,8 +201,8 @@ func (p *Parser) Unmarshal(val interface{}, start *StartElement) error { func fieldName(original string) string { var i int - //remove leading underscores - for i = 0; i < len(original) && original[i] == '_'; i++ { + //remove leading underscores, without exhausting all characters + for i = 0; i < len(original)-1 && original[i] == '_'; i++ { } return strings.Map( @@ -617,7 +617,7 @@ func (p *Parser) Skip() error { if err != nil { return err } - switch t := tok.(type) { + switch tok.(type) { case StartElement: if err := p.Skip(); err != nil { return err diff --git a/libgo/go/xml/read_test.go b/libgo/go/encoding/xml/read_test.go similarity index 98% rename from libgo/go/xml/read_test.go rename to libgo/go/encoding/xml/read_test.go index d39c2d52a83..fbb7fd5d2f2 100644 --- a/libgo/go/xml/read_test.go +++ b/libgo/go/encoding/xml/read_test.go @@ -245,6 +245,9 @@ const pathTestString = ` C D + <_> + E + 2 @@ -279,11 +282,17 @@ type PathTestD struct { Before, After string } +type PathTestE struct { + Underline string `xml:"items>_>value"` + Before, After string +} + var pathTests = []interface{}{ &PathTestA{Items: []PathTestItem{{"A"}, {"D"}}, Before: "1", After: "2"}, &PathTestB{Other: []PathTestItem{{"A"}, {"D"}}, Before: "1", After: "2"}, &PathTestC{Values1: []string{"A", "C", "D"}, Values2: []string{"B"}, Before: "1", After: "2"}, &PathTestD{Other: PathTestSet{Item1: []PathTestItem{{"A"}, {"D"}}}, Before: "1", After: "2"}, + &PathTestE{Underline: "E", Before: "1", After: "2"}, } func TestUnmarshalPaths(t *testing.T) { diff --git a/libgo/go/xml/xml.go b/libgo/go/encoding/xml/xml.go similarity index 99% rename from libgo/go/xml/xml.go rename to libgo/go/encoding/xml/xml.go index d534c52c1ca..216d8889b23 100644 --- a/libgo/go/xml/xml.go +++ b/libgo/go/encoding/xml/xml.go @@ -21,7 +21,7 @@ import ( "strconv" "strings" "unicode" - "utf8" + "unicode/utf8" ) // A SyntaxError represents a syntax error in the XML input stream. @@ -197,7 +197,7 @@ func NewParser(r io.Reader) *Parser { } // Token returns the next XML token in the input stream. -// At the end of the input stream, Token returns nil, os.EOF. +// At the end of the input stream, Token returns nil, io.EOF. // // Slices of bytes in the returned token data refer to the // parser's internal buffer and remain valid only until the next diff --git a/libgo/go/xml/xml_test.go b/libgo/go/encoding/xml/xml_test.go similarity index 98% rename from libgo/go/xml/xml_test.go rename to libgo/go/encoding/xml/xml_test.go index 1b40d0c4d41..6c874fadb7a 100644 --- a/libgo/go/xml/xml_test.go +++ b/libgo/go/encoding/xml/xml_test.go @@ -520,7 +520,7 @@ func TestTrailingRawToken(t *testing.T) { for _, err = p.RawToken(); err == nil; _, err = p.RawToken() { } if err != io.EOF { - t.Fatalf("p.RawToken() = _, %v, want _, os.EOF", err) + t.Fatalf("p.RawToken() = _, %v, want _, io.EOF", err) } } @@ -531,7 +531,7 @@ func TestTrailingToken(t *testing.T) { for _, err = p.Token(); err == nil; _, err = p.Token() { } if err != io.EOF { - t.Fatalf("p.Token() = _, %v, want _, os.EOF", err) + t.Fatalf("p.Token() = _, %v, want _, io.EOF", err) } } @@ -542,7 +542,7 @@ func TestEntityInsideCDATA(t *testing.T) { for _, err = p.Token(); err == nil; _, err = p.Token() { } if err != io.EOF { - t.Fatalf("p.Token() = _, %v, want _, os.EOF", err) + t.Fatalf("p.Token() = _, %v, want _, io.EOF", err) } } diff --git a/libgo/go/exp/ebnf/ebnf.go b/libgo/go/exp/ebnf/ebnf.go index 15c199af6cb..cd8c83c9210 100644 --- a/libgo/go/exp/ebnf/ebnf.go +++ b/libgo/go/exp/ebnf/ebnf.go @@ -25,9 +25,9 @@ package ebnf import ( "errors" "fmt" - "scanner" + "text/scanner" "unicode" - "utf8" + "unicode/utf8" ) // ---------------------------------------------------------------------------- diff --git a/libgo/go/exp/ebnf/parser.go b/libgo/go/exp/ebnf/parser.go index 2dad9b4c13d..7a7e3cc16e4 100644 --- a/libgo/go/exp/ebnf/parser.go +++ b/libgo/go/exp/ebnf/parser.go @@ -6,8 +6,8 @@ package ebnf import ( "io" - "scanner" "strconv" + "text/scanner" ) type parser struct { diff --git a/libgo/go/exp/norm/composition.go b/libgo/go/exp/norm/composition.go index 7965ffc5742..7cad8a2ccd7 100644 --- a/libgo/go/exp/norm/composition.go +++ b/libgo/go/exp/norm/composition.go @@ -4,7 +4,7 @@ package norm -import "utf8" +import "unicode/utf8" const ( maxCombiningChars = 30 diff --git a/libgo/go/exp/norm/input.go b/libgo/go/exp/norm/input.go index 12360a8fda1..ce159e9050c 100644 --- a/libgo/go/exp/norm/input.go +++ b/libgo/go/exp/norm/input.go @@ -4,7 +4,7 @@ package norm -import "utf8" +import "unicode/utf8" type input interface { skipASCII(p int) int diff --git a/libgo/go/exp/norm/maketables.go b/libgo/go/exp/norm/maketables.go index c7a3762bdeb..39bab7f0b6a 100644 --- a/libgo/go/exp/norm/maketables.go +++ b/libgo/go/exp/norm/maketables.go @@ -12,9 +12,9 @@ import ( "bytes" "flag" "fmt" - "http" "io" "log" + "net/http" "os" "regexp" "strconv" diff --git a/libgo/go/exp/norm/normalize.go b/libgo/go/exp/norm/normalize.go index 391bc4184f2..25bb28d517f 100644 --- a/libgo/go/exp/norm/normalize.go +++ b/libgo/go/exp/norm/normalize.go @@ -5,7 +5,7 @@ // Package norm contains types and functions for normalizing Unicode strings. package norm -import "utf8" +import "unicode/utf8" // A Form denotes a canonical representation of Unicode code points. // The Unicode-defined normalization and equivalence forms are: diff --git a/libgo/go/exp/norm/normregtest.go b/libgo/go/exp/norm/normregtest.go index 744bb1cd6c2..6610c257e51 100644 --- a/libgo/go/exp/norm/normregtest.go +++ b/libgo/go/exp/norm/normregtest.go @@ -10,9 +10,9 @@ import ( "exp/norm" "flag" "fmt" - "http" "io" "log" + "net/http" "os" "path" "regexp" @@ -20,7 +20,7 @@ import ( "strconv" "strings" "time" - "utf8" + "unicode/utf8" ) func main() { diff --git a/libgo/go/exp/norm/trie_test.go b/libgo/go/exp/norm/trie_test.go index bbd5c03e7b3..7308d281b50 100644 --- a/libgo/go/exp/norm/trie_test.go +++ b/libgo/go/exp/norm/trie_test.go @@ -2,7 +2,7 @@ package norm import ( "testing" - "utf8" + "unicode/utf8" ) // Test data is located in triedata_test.go; generated by maketesttables. diff --git a/libgo/go/exp/norm/triegen.go b/libgo/go/exp/norm/triegen.go index 56cba321966..5edadac0a41 100644 --- a/libgo/go/exp/norm/triegen.go +++ b/libgo/go/exp/norm/triegen.go @@ -14,7 +14,7 @@ import ( "fmt" "hash/crc32" "log" - "utf8" + "unicode/utf8" ) const blockSize = 64 diff --git a/libgo/go/exp/spdy/read.go b/libgo/go/exp/spdy/read.go index 3de80c04d78..4830a1d6bfd 100644 --- a/libgo/go/exp/spdy/read.go +++ b/libgo/go/exp/spdy/read.go @@ -7,8 +7,8 @@ package spdy import ( "compress/zlib" "encoding/binary" - "http" "io" + "net/http" "strings" ) diff --git a/libgo/go/exp/spdy/spdy_test.go b/libgo/go/exp/spdy/spdy_test.go index cb91e028613..c1cad4b37c6 100644 --- a/libgo/go/exp/spdy/spdy_test.go +++ b/libgo/go/exp/spdy/spdy_test.go @@ -6,8 +6,8 @@ package spdy import ( "bytes" - "http" "io" + "net/http" "reflect" "testing" ) diff --git a/libgo/go/exp/spdy/types.go b/libgo/go/exp/spdy/types.go index 87d6edbd560..2648c4f75f9 100644 --- a/libgo/go/exp/spdy/types.go +++ b/libgo/go/exp/spdy/types.go @@ -7,8 +7,8 @@ package spdy import ( "bytes" "compress/zlib" - "http" "io" + "net/http" ) // Data Frame Format diff --git a/libgo/go/exp/spdy/write.go b/libgo/go/exp/spdy/write.go index 537154fbd3d..3dd2ca1d5d8 100644 --- a/libgo/go/exp/spdy/write.go +++ b/libgo/go/exp/spdy/write.go @@ -6,8 +6,8 @@ package spdy import ( "encoding/binary" - "http" "io" + "net/http" "strings" ) diff --git a/libgo/go/exp/sql/convert.go b/libgo/go/exp/sql/convert.go index b1feef0eb82..e46cebe9a3d 100644 --- a/libgo/go/exp/sql/convert.go +++ b/libgo/go/exp/sql/convert.go @@ -8,6 +8,7 @@ package sql import ( "errors" + "exp/sql/driver" "fmt" "reflect" "strconv" @@ -36,10 +37,11 @@ func convertAssign(dest, src interface{}) error { } } - sv := reflect.ValueOf(src) + var sv reflect.Value switch d := dest.(type) { case *string: + sv = reflect.ValueOf(src) switch sv.Kind() { case reflect.Bool, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, @@ -48,6 +50,12 @@ func convertAssign(dest, src interface{}) error { *d = fmt.Sprintf("%v", src) return nil } + case *bool: + bv, err := driver.Bool.ConvertValue(src) + if err == nil { + *d = bv.(bool) + } + return err } if scanner, ok := dest.(ScannerInto); ok { @@ -59,6 +67,10 @@ func convertAssign(dest, src interface{}) error { return errors.New("destination not a pointer") } + if !sv.IsValid() { + sv = reflect.ValueOf(src) + } + dv := reflect.Indirect(dpv) if dv.Kind() == sv.Kind() { dv.Set(sv) @@ -67,40 +79,49 @@ func convertAssign(dest, src interface{}) error { switch dv.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - if s, ok := asString(src); ok { - i64, err := strconv.Atoi64(s) - if err != nil { - return fmt.Errorf("converting string %q to a %s: %v", s, dv.Kind(), err) - } - if dv.OverflowInt(i64) { - return fmt.Errorf("string %q overflows %s", s, dv.Kind()) - } - dv.SetInt(i64) - return nil + s := asString(src) + i64, err := strconv.Atoi64(s) + if err != nil { + return fmt.Errorf("converting string %q to a %s: %v", s, dv.Kind(), err) } + if dv.OverflowInt(i64) { + return fmt.Errorf("string %q overflows %s", s, dv.Kind()) + } + dv.SetInt(i64) + return nil case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: - if s, ok := asString(src); ok { - u64, err := strconv.Atoui64(s) - if err != nil { - return fmt.Errorf("converting string %q to a %s: %v", s, dv.Kind(), err) - } - if dv.OverflowUint(u64) { - return fmt.Errorf("string %q overflows %s", s, dv.Kind()) - } - dv.SetUint(u64) - return nil + s := asString(src) + u64, err := strconv.Atoui64(s) + if err != nil { + return fmt.Errorf("converting string %q to a %s: %v", s, dv.Kind(), err) } + if dv.OverflowUint(u64) { + return fmt.Errorf("string %q overflows %s", s, dv.Kind()) + } + dv.SetUint(u64) + return nil + case reflect.Float32, reflect.Float64: + s := asString(src) + f64, err := strconv.Atof64(s) + if err != nil { + return fmt.Errorf("converting string %q to a %s: %v", s, dv.Kind(), err) + } + if dv.OverflowFloat(f64) { + return fmt.Errorf("value %q overflows %s", s, dv.Kind()) + } + dv.SetFloat(f64) + return nil } return fmt.Errorf("unsupported driver -> Scan pair: %T -> %T", src, dest) } -func asString(src interface{}) (s string, ok bool) { +func asString(src interface{}) string { switch v := src.(type) { case string: - return v, true + return v case []byte: - return string(v), true + return string(v) } - return "", false + return fmt.Sprintf("%v", src) } diff --git a/libgo/go/exp/sql/convert_test.go b/libgo/go/exp/sql/convert_test.go index f85ed99978d..52cee927241 100644 --- a/libgo/go/exp/sql/convert_test.go +++ b/libgo/go/exp/sql/convert_test.go @@ -17,6 +17,9 @@ type conversionTest struct { wantint int64 wantuint uint64 wantstr string + wantf32 float32 + wantf64 float64 + wantbool bool // used if d is of type *bool wanterr string } @@ -29,6 +32,9 @@ var ( scanint32 int32 scanuint8 uint8 scanuint16 uint16 + scanbool bool + scanf32 float32 + scanf64 float64 ) var conversionTests = []conversionTest{ @@ -53,6 +59,35 @@ var conversionTests = []conversionTest{ {s: "256", d: &scanuint16, wantuint: 256}, {s: "-1", d: &scanint, wantint: -1}, {s: "foo", d: &scanint, wanterr: `converting string "foo" to a int: parsing "foo": invalid syntax`}, + + // True bools + {s: true, d: &scanbool, wantbool: true}, + {s: "True", d: &scanbool, wantbool: true}, + {s: "TRUE", d: &scanbool, wantbool: true}, + {s: "1", d: &scanbool, wantbool: true}, + {s: 1, d: &scanbool, wantbool: true}, + {s: int64(1), d: &scanbool, wantbool: true}, + {s: uint16(1), d: &scanbool, wantbool: true}, + + // False bools + {s: false, d: &scanbool, wantbool: false}, + {s: "false", d: &scanbool, wantbool: false}, + {s: "FALSE", d: &scanbool, wantbool: false}, + {s: "0", d: &scanbool, wantbool: false}, + {s: 0, d: &scanbool, wantbool: false}, + {s: int64(0), d: &scanbool, wantbool: false}, + {s: uint16(0), d: &scanbool, wantbool: false}, + + // Not bools + {s: "yup", d: &scanbool, wanterr: `sql/driver: couldn't convert "yup" into type bool`}, + {s: 2, d: &scanbool, wanterr: `sql/driver: couldn't convert 2 into type bool`}, + + // Floats + {s: float64(1.5), d: &scanf64, wantf64: float64(1.5)}, + {s: int64(1), d: &scanf64, wantf64: float64(1)}, + {s: float64(1.5), d: &scanf32, wantf32: float32(1.5)}, + {s: "1.5", d: &scanf32, wantf32: float32(1.5)}, + {s: "1.5", d: &scanf64, wantf64: float64(1.5)}, } func intValue(intptr interface{}) int64 { @@ -63,6 +98,14 @@ func uintValue(intptr interface{}) uint64 { return reflect.Indirect(reflect.ValueOf(intptr)).Uint() } +func float64Value(ptr interface{}) float64 { + return *(ptr.(*float64)) +} + +func float32Value(ptr interface{}) float32 { + return *(ptr.(*float32)) +} + func TestConversions(t *testing.T) { for n, ct := range conversionTests { err := convertAssign(ct.d, ct.s) @@ -86,6 +129,15 @@ func TestConversions(t *testing.T) { if ct.wantuint != 0 && ct.wantuint != uintValue(ct.d) { errf("want uint %d, got %d", ct.wantuint, uintValue(ct.d)) } + if ct.wantf32 != 0 && ct.wantf32 != float32Value(ct.d) { + errf("want float32 %v, got %v", ct.wantf32, float32Value(ct.d)) + } + if ct.wantf64 != 0 && ct.wantf64 != float64Value(ct.d) { + errf("want float32 %v, got %v", ct.wantf64, float64Value(ct.d)) + } + if bp, boolTest := ct.d.(*bool); boolTest && *bp != ct.wantbool && ct.wanterr == "" { + errf("want bool %v, got %v", ct.wantbool, *bp) + } } } diff --git a/libgo/go/exp/sql/driver/driver.go b/libgo/go/exp/sql/driver/driver.go index 52714e817a3..6a51c342415 100644 --- a/libgo/go/exp/sql/driver/driver.go +++ b/libgo/go/exp/sql/driver/driver.go @@ -24,9 +24,13 @@ import "errors" // Driver is the interface that must be implemented by a database // driver. type Driver interface { - // Open returns a new or cached connection to the database. + // Open returns a new connection to the database. // The name is a string in a driver-specific format. // + // Open may return a cached connection (one previously + // closed), but doing so is unnecessary; the sql package + // maintains a pool of idle connections for efficient re-use. + // // The returned connection is only used by one goroutine at a // time. Open(name string) (Conn, error) @@ -59,8 +63,12 @@ type Conn interface { // Close invalidates and potentially stops any current // prepared statements and transactions, marking this - // connection as no longer in use. The driver may cache or - // close its underlying connection to its database. + // connection as no longer in use. + // + // Because the sql package maintains a free pool of + // connections and only calls Close when there's a surplus of + // idle connections, it shouldn't be necessary for drivers to + // do their own connection caching. Close() error // Begin starts and returns a new transaction. diff --git a/libgo/go/exp/sql/driver/types.go b/libgo/go/exp/sql/driver/types.go index 9faf32f671a..6e0ce4339cc 100644 --- a/libgo/go/exp/sql/driver/types.go +++ b/libgo/go/exp/sql/driver/types.go @@ -11,6 +11,21 @@ import ( ) // ValueConverter is the interface providing the ConvertValue method. +// +// Various implementations of ValueConverter are provided by the +// driver package to provide consistent implementations of conversions +// between drivers. The ValueConverters have several uses: +// +// * converting from the subset types as provided by the sql package +// into a database table's specific column type and making sure it +// fits, such as making sure a particular int64 fits in a +// table's uint16 column. +// +// * converting a value as given from the database into one of the +// subset types. +// +// * by the sql package, for converting from a driver's subset type +// to a user's type in a scan. type ValueConverter interface { // ConvertValue converts a value to a restricted subset type. ConvertValue(v interface{}) (interface{}, error) @@ -19,15 +34,56 @@ type ValueConverter interface { // Bool is a ValueConverter that converts input values to bools. // // The conversion rules are: -// - .... TODO(bradfitz): TBD +// - booleans are returned unchanged +// - for integer types, +// 1 is true +// 0 is false, +// other integers are an error +// - for strings and []byte, same rules as strconv.Atob +// - all other types are an error var Bool boolType type boolType struct{} var _ ValueConverter = boolType{} -func (boolType) ConvertValue(v interface{}) (interface{}, error) { - return nil, fmt.Errorf("TODO(bradfitz): bool conversions") +func (boolType) String() string { return "Bool" } + +func (boolType) ConvertValue(src interface{}) (interface{}, error) { + switch s := src.(type) { + case bool: + return s, nil + case string: + b, err := strconv.Atob(s) + if err != nil { + return nil, fmt.Errorf("sql/driver: couldn't convert %q into type bool", s) + } + return b, nil + case []byte: + b, err := strconv.Atob(string(s)) + if err != nil { + return nil, fmt.Errorf("sql/driver: couldn't convert %q into type bool", s) + } + return b, nil + } + + sv := reflect.ValueOf(src) + switch sv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + iv := sv.Int() + if iv == 1 || iv == 0 { + return iv == 1, nil + } + return nil, fmt.Errorf("sql/driver: couldn't convert %d into type bool", iv) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + uv := sv.Uint() + if uv == 1 || uv == 0 { + return uv == 1, nil + } + return nil, fmt.Errorf("sql/driver: couldn't convert %d into type bool", uv) + } + + return nil, fmt.Errorf("sql/driver: couldn't convert %v (%T) into type bool", src, src) } // Int32 is a ValueConverter that converts input values to int64, diff --git a/libgo/go/exp/sql/driver/types_test.go b/libgo/go/exp/sql/driver/types_test.go new file mode 100644 index 00000000000..4b049e26e51 --- /dev/null +++ b/libgo/go/exp/sql/driver/types_test.go @@ -0,0 +1,57 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package driver + +import ( + "reflect" + "testing" +) + +type valueConverterTest struct { + c ValueConverter + in interface{} + out interface{} + err string +} + +var valueConverterTests = []valueConverterTest{ + {Bool, "true", true, ""}, + {Bool, "True", true, ""}, + {Bool, []byte("t"), true, ""}, + {Bool, true, true, ""}, + {Bool, "1", true, ""}, + {Bool, 1, true, ""}, + {Bool, int64(1), true, ""}, + {Bool, uint16(1), true, ""}, + {Bool, "false", false, ""}, + {Bool, false, false, ""}, + {Bool, "0", false, ""}, + {Bool, 0, false, ""}, + {Bool, int64(0), false, ""}, + {Bool, uint16(0), false, ""}, + {c: Bool, in: "foo", err: "sql/driver: couldn't convert \"foo\" into type bool"}, + {c: Bool, in: 2, err: "sql/driver: couldn't convert 2 into type bool"}, +} + +func TestValueConverters(t *testing.T) { + for i, tt := range valueConverterTests { + out, err := tt.c.ConvertValue(tt.in) + goterr := "" + if err != nil { + goterr = err.Error() + } + if goterr != tt.err { + t.Errorf("test %d: %s(%T(%v)) error = %q; want error = %q", + i, tt.c, tt.in, tt.in, goterr, tt.err) + } + if tt.err != "" { + continue + } + if !reflect.DeepEqual(out, tt.out) { + t.Errorf("test %d: %s(%T(%v)) = %v (%T); want %v (%T)", + i, tt.c, tt.in, tt.in, out, out, tt.out, tt.out) + } + } +} diff --git a/libgo/go/exp/sql/fakedb_test.go b/libgo/go/exp/sql/fakedb_test.go index 289294bee26..c8a19974d64 100644 --- a/libgo/go/exp/sql/fakedb_test.go +++ b/libgo/go/exp/sql/fakedb_test.go @@ -476,7 +476,7 @@ func (rc *rowsCursor) Next(dest []interface{}) error { for i, v := range rc.rows[rc.pos].cols { // TODO(bradfitz): convert to subset types? naah, I // think the subset types should only be input to - // driver, but the db package should be able to handle + // driver, but the sql package should be able to handle // a wider range of types coming out of drivers. all // for ease of drivers, and to prevent drivers from // messing up conversions or doing them differently. diff --git a/libgo/go/exp/sql/sql.go b/libgo/go/exp/sql/sql.go index 4f1c539127c..291af7f67dc 100644 --- a/libgo/go/exp/sql/sql.go +++ b/libgo/go/exp/sql/sql.go @@ -10,7 +10,6 @@ import ( "errors" "fmt" "io" - "runtime" "sync" "exp/sql/driver" @@ -192,13 +191,13 @@ func (db *DB) Exec(query string, args ...interface{}) (Result, error) { // If the driver does not implement driver.Execer, we need // a connection. - conn, err := db.conn() + ci, err := db.conn() if err != nil { return nil, err } - defer db.putConn(conn) + defer db.putConn(ci) - if execer, ok := conn.(driver.Execer); ok { + if execer, ok := ci.(driver.Execer); ok { resi, err := execer.Exec(query, args) if err != nil { return nil, err @@ -206,7 +205,7 @@ func (db *DB) Exec(query string, args ...interface{}) (Result, error) { return result{resi}, nil } - sti, err := conn.Prepare(query) + sti, err := ci.Prepare(query) if err != nil { return nil, err } @@ -233,18 +232,26 @@ func (db *DB) Query(query string, args ...interface{}) (*Rows, error) { // Row's Scan method is called. func (db *DB) QueryRow(query string, args ...interface{}) *Row { rows, err := db.Query(query, args...) - if err != nil { - return &Row{err: err} - } - return &Row{rows: rows} + return &Row{rows: rows, err: err} } -// Begin starts a transaction. The isolation level is dependent on +// Begin starts a transaction. The isolation level is dependent on // the driver. func (db *DB) Begin() (*Tx, error) { - // TODO(bradfitz): add another method for beginning a transaction - // at a specific isolation level. - panic(todo()) + ci, err := db.conn() + if err != nil { + return nil, err + } + txi, err := ci.Begin() + if err != nil { + db.putConn(ci) + return nil, fmt.Errorf("sql: failed to Begin transaction: %v", err) + } + return &Tx{ + db: db, + ci: ci, + txi: txi, + }, nil } // DriverDatabase returns the database's underlying driver. @@ -253,41 +260,158 @@ func (db *DB) Driver() driver.Driver { } // Tx is an in-progress database transaction. +// +// A transaction must end with a call to Commit or Rollback. +// +// After a call to Commit or Rollback, all operations on the +// transaction fail with ErrTransactionFinished. type Tx struct { + db *DB + // ci is owned exclusively until Commit or Rollback, at which point + // it's returned with putConn. + ci driver.Conn + txi driver.Tx + + // cimu is held while somebody is using ci (between grabConn + // and releaseConn) + cimu sync.Mutex + + // done transitions from false to true exactly once, on Commit + // or Rollback. once done, all operations fail with + // ErrTransactionFinished. + done bool +} + +var ErrTransactionFinished = errors.New("sql: Transaction has already been committed or rolled back") + +func (tx *Tx) close() { + if tx.done { + panic("double close") // internal error + } + tx.done = true + tx.db.putConn(tx.ci) + tx.ci = nil + tx.txi = nil +} + +func (tx *Tx) grabConn() (driver.Conn, error) { + if tx.done { + return nil, ErrTransactionFinished + } + tx.cimu.Lock() + return tx.ci, nil +} + +func (tx *Tx) releaseConn() { + tx.cimu.Unlock() } // Commit commits the transaction. func (tx *Tx) Commit() error { - panic(todo()) + if tx.done { + return ErrTransactionFinished + } + defer tx.close() + return tx.txi.Commit() } // Rollback aborts the transaction. func (tx *Tx) Rollback() error { - panic(todo()) + if tx.done { + return ErrTransactionFinished + } + defer tx.close() + return tx.txi.Rollback() } // Prepare creates a prepared statement. +// +// The statement is only valid within the scope of this transaction. func (tx *Tx) Prepare(query string) (*Stmt, error) { - panic(todo()) + // TODO(bradfitz): the restriction that the returned statement + // is only valid for this Transaction is lame and negates a + // lot of the benefit of prepared statements. We could be + // more efficient here and either provide a method to take an + // existing Stmt (created on perhaps a different Conn), and + // re-create it on this Conn if necessary. Or, better: keep a + // map in DB of query string to Stmts, and have Stmt.Execute + // do the right thing and re-prepare if the Conn in use + // doesn't have that prepared statement. But we'll want to + // avoid caching the statement in the case where we only call + // conn.Prepare implicitly (such as in db.Exec or tx.Exec), + // but the caller package can't be holding a reference to the + // returned statement. Perhaps just looking at the reference + // count (by noting Stmt.Close) would be enough. We might also + // want a finalizer on Stmt to drop the reference count. + ci, err := tx.grabConn() + if err != nil { + return nil, err + } + defer tx.releaseConn() + + si, err := ci.Prepare(query) + if err != nil { + return nil, err + } + + stmt := &Stmt{ + db: tx.db, + tx: tx, + txsi: si, + query: query, + } + return stmt, nil } // Exec executes a query that doesn't return rows. // For example: an INSERT and UPDATE. -func (tx *Tx) Exec(query string, args ...interface{}) { - panic(todo()) +func (tx *Tx) Exec(query string, args ...interface{}) (Result, error) { + ci, err := tx.grabConn() + if err != nil { + return nil, err + } + defer tx.releaseConn() + + if execer, ok := ci.(driver.Execer); ok { + resi, err := execer.Exec(query, args) + if err != nil { + return nil, err + } + return result{resi}, nil + } + + sti, err := ci.Prepare(query) + if err != nil { + return nil, err + } + defer sti.Close() + resi, err := sti.Exec(args) + if err != nil { + return nil, err + } + return result{resi}, nil } // Query executes a query that returns rows, typically a SELECT. func (tx *Tx) Query(query string, args ...interface{}) (*Rows, error) { - panic(todo()) + if tx.done { + return nil, ErrTransactionFinished + } + stmt, err := tx.Prepare(query) + if err != nil { + return nil, err + } + defer stmt.Close() + return stmt.Query(args...) } // QueryRow executes a query that is expected to return at most one row. // QueryRow always return a non-nil value. Errors are deferred until // Row's Scan method is called. func (tx *Tx) QueryRow(query string, args ...interface{}) *Row { - panic(todo()) + rows, err := tx.Query(query, args...) + return &Row{rows: rows, err: err} } // connStmt is a prepared statement on a particular connection. @@ -302,24 +426,28 @@ type Stmt struct { db *DB // where we came from query string // that created the Sttm - mu sync.Mutex - closed bool - css []connStmt // can use any that have idle connections -} + // If in a transaction, else both nil: + tx *Tx + txsi driver.Stmt -func todo() string { - _, file, line, _ := runtime.Caller(1) - return fmt.Sprintf("%s:%d: TODO: implement", file, line) + mu sync.Mutex // protects the rest of the fields + closed bool + + // css is a list of underlying driver statement interfaces + // that are valid on particular connections. This is only + // used if tx == nil and one is found that has idle + // connections. If tx != nil, txsi is always used. + css []connStmt } // Exec executes a prepared statement with the given arguments and // returns a Result summarizing the effect of the statement. func (s *Stmt) Exec(args ...interface{}) (Result, error) { - ci, si, err := s.connStmt() + _, releaseConn, si, err := s.connStmt() if err != nil { return nil, err } - defer s.db.putConn(ci) + defer releaseConn() if want := si.NumInput(); len(args) != want { return nil, fmt.Errorf("db: expected %d arguments, got %d", want, len(args)) @@ -353,11 +481,29 @@ func (s *Stmt) Exec(args ...interface{}) (Result, error) { return result{resi}, nil } -func (s *Stmt) connStmt(args ...interface{}) (driver.Conn, driver.Stmt, error) { +// connStmt returns a free driver connection on which to execute the +// statement, a function to call to release the connection, and a +// statement bound to that connection. +func (s *Stmt) connStmt() (ci driver.Conn, releaseConn func(), si driver.Stmt, err error) { s.mu.Lock() if s.closed { - return nil, nil, errors.New("db: statement is closed") + s.mu.Unlock() + err = errors.New("db: statement is closed") + return } + + // In a transaction, we always use the connection that the + // transaction was created on. + if s.tx != nil { + s.mu.Unlock() + ci, err = s.tx.grabConn() // blocks, waiting for the connection. + if err != nil { + return + } + releaseConn = func() { s.tx.releaseConn() } + return ci, releaseConn, s.txsi, nil + } + var cs connStmt match := false for _, v := range s.css { @@ -375,11 +521,11 @@ func (s *Stmt) connStmt(args ...interface{}) (driver.Conn, driver.Stmt, error) { if !match { ci, err := s.db.conn() if err != nil { - return nil, nil, err + return nil, nil, nil, err } si, err := ci.Prepare(s.query) if err != nil { - return nil, nil, err + return nil, nil, nil, err } s.mu.Lock() cs = connStmt{ci, si} @@ -387,13 +533,15 @@ func (s *Stmt) connStmt(args ...interface{}) (driver.Conn, driver.Stmt, error) { s.mu.Unlock() } - return cs.ci, cs.si, nil + conn := cs.ci + releaseConn = func() { s.db.putConn(conn) } + return conn, releaseConn, cs.si, nil } // Query executes a prepared query statement with the given arguments // and returns the query results as a *Rows. func (s *Stmt) Query(args ...interface{}) (*Rows, error) { - ci, si, err := s.connStmt(args...) + ci, releaseConn, si, err := s.connStmt() if err != nil { return nil, err } @@ -405,11 +553,13 @@ func (s *Stmt) Query(args ...interface{}) (*Rows, error) { s.db.putConn(ci) return nil, err } - // Note: ownership of ci passes to the *Rows + // Note: ownership of ci passes to the *Rows, to be freed + // with releaseConn. rows := &Rows{ - db: s.db, - ci: ci, - rowsi: rowsi, + db: s.db, + ci: ci, + releaseConn: releaseConn, + rowsi: rowsi, } return rows, nil } @@ -436,19 +586,24 @@ func (s *Stmt) QueryRow(args ...interface{}) *Row { // Close closes the statement. func (s *Stmt) Close() error { s.mu.Lock() - defer s.mu.Unlock() // TODO(bradfitz): move this unlock after 'closed = true'? + defer s.mu.Unlock() if s.closed { return nil } s.closed = true - for _, v := range s.css { - if ci, match := s.db.connIfFree(v.ci); match { - v.si.Close() - s.db.putConn(ci) - } else { - // TODO(bradfitz): care that we can't close - // this statement because the statement's - // connection is in use? + + if s.tx != nil { + s.txsi.Close() + } else { + for _, v := range s.css { + if ci, match := s.db.connIfFree(v.ci); match { + v.si.Close() + s.db.putConn(ci) + } else { + // TODO(bradfitz): care that we can't close + // this statement because the statement's + // connection is in use? + } } } return nil @@ -465,12 +620,13 @@ func (s *Stmt) Close() error { // err = rows.Scan(&id, &name) // ... // } -// err = rows.Error() // get any Error encountered during iteration +// err = rows.Err() // get any error encountered during iteration // ... type Rows struct { - db *DB - ci driver.Conn // owned; must be returned when Rows is closed - rowsi driver.Rows + db *DB + ci driver.Conn // owned; must call putconn when closed to release + releaseConn func() + rowsi driver.Rows closed bool lastcols []interface{} @@ -495,8 +651,8 @@ func (rs *Rows) Next() bool { return rs.lasterr == nil } -// Error returns the error, if any, that was encountered during iteration. -func (rs *Rows) Error() error { +// Err returns the error, if any, that was encountered during iteration. +func (rs *Rows) Err() error { if rs.lasterr == io.EOF { return nil } @@ -538,7 +694,7 @@ func (rs *Rows) Close() error { } rs.closed = true err := rs.rowsi.Close() - rs.db.putConn(rs.ci) + rs.releaseConn() return err } diff --git a/libgo/go/exp/ssh/client.go b/libgo/go/exp/ssh/client.go index 345e707b336..da45688eee0 100644 --- a/libgo/go/exp/ssh/client.go +++ b/libgo/go/exp/ssh/client.go @@ -5,12 +5,12 @@ package ssh import ( - "big" "crypto" "crypto/rand" "errors" "fmt" "io" + "math/big" "net" "sync" ) @@ -131,56 +131,6 @@ func (c *ClientConn) handshake() error { return c.transport.reader.setupKeys(serverKeys, K, H, H, hashFunc) } -// authenticate authenticates with the remote server. See RFC 4252. -// Only "password" authentication is supported. -func (c *ClientConn) authenticate() error { - if err := c.writePacket(marshal(msgServiceRequest, serviceRequestMsg{serviceUserAuth})); err != nil { - return err - } - packet, err := c.readPacket() - if err != nil { - return err - } - - var serviceAccept serviceAcceptMsg - if err = unmarshal(&serviceAccept, packet, msgServiceAccept); err != nil { - return err - } - - // TODO(dfc) support proper authentication method negotation - method := "none" - if c.config.Password != "" { - method = "password" - } - if err := c.sendUserAuthReq(method); err != nil { - return err - } - - if packet, err = c.readPacket(); err != nil { - return err - } - - if packet[0] != msgUserAuthSuccess { - return UnexpectedMessageError{msgUserAuthSuccess, packet[0]} - } - return nil -} - -func (c *ClientConn) sendUserAuthReq(method string) error { - length := stringLength([]byte(c.config.Password)) + 1 - payload := make([]byte, length) - // always false for password auth, see RFC 4252 Section 8. - payload[0] = 0 - marshalString(payload[1:], []byte(c.config.Password)) - - return c.writePacket(marshal(msgUserAuthRequest, userAuthRequestMsg{ - User: c.config.User, - Service: serviceSSH, - Method: method, - Payload: payload, - })) -} - // kexDH performs Diffie-Hellman key agreement on a ClientConn. The // returned values are given the same names as in RFC 4253, section 8. func (c *ClientConn) kexDH(group *dhGroup, hashFunc crypto.Hash, magics *handshakeMagics, hostKeyAlgo string) ([]byte, []byte, error) { @@ -348,8 +298,9 @@ type ClientConfig struct { // The username to authenticate. User string - // Used for "password" method authentication. - Password string + // A slice of ClientAuth methods. Only the first instance + // of a particular RFC 4252 method will be used during authentication. + Auth []ClientAuth } func (c *ClientConfig) rand() io.Reader { diff --git a/libgo/go/exp/ssh/client_auth.go b/libgo/go/exp/ssh/client_auth.go new file mode 100644 index 00000000000..0089d0c769e --- /dev/null +++ b/libgo/go/exp/ssh/client_auth.go @@ -0,0 +1,157 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ssh + +import ( + "errors" +) + +// authenticate authenticates with the remote server. See RFC 4252. +func (c *ClientConn) authenticate() error { + // initiate user auth session + if err := c.writePacket(marshal(msgServiceRequest, serviceRequestMsg{serviceUserAuth})); err != nil { + return err + } + packet, err := c.readPacket() + if err != nil { + return err + } + var serviceAccept serviceAcceptMsg + if err := unmarshal(&serviceAccept, packet, msgServiceAccept); err != nil { + return err + } + // during the authentication phase the client first attempts the "none" method + // then any untried methods suggested by the server. + tried, remain := make(map[string]bool), make(map[string]bool) + for auth := ClientAuth(new(noneAuth)); auth != nil; { + ok, methods, err := auth.auth(c.config.User, c.transport) + if err != nil { + return err + } + if ok { + // success + return nil + } + tried[auth.method()] = true + delete(remain, auth.method()) + for _, meth := range methods { + if tried[meth] { + // if we've tried meth already, skip it. + continue + } + remain[meth] = true + } + auth = nil + for _, a := range c.config.Auth { + if remain[a.method()] { + auth = a + break + } + } + } + return errors.New("ssh: unable to authenticate, no supported methods remain") +} + +// A ClientAuth represents an instance of an RFC 4252 authentication method. +type ClientAuth interface { + // auth authenticates user over transport t. + // Returns true if authentication is successful. + // If authentication is not successful, a []string of alternative + // method names is returned. + auth(user string, t *transport) (bool, []string, error) + + // method returns the RFC 4252 method name. + method() string +} + +// "none" authentication, RFC 4252 section 5.2. +type noneAuth int + +func (n *noneAuth) auth(user string, t *transport) (bool, []string, error) { + if err := t.writePacket(marshal(msgUserAuthRequest, userAuthRequestMsg{ + User: user, + Service: serviceSSH, + Method: "none", + })); err != nil { + return false, nil, err + } + + packet, err := t.readPacket() + if err != nil { + return false, nil, err + } + + switch packet[0] { + case msgUserAuthSuccess: + return true, nil, nil + case msgUserAuthFailure: + msg := decode(packet).(*userAuthFailureMsg) + return false, msg.Methods, nil + } + return false, nil, UnexpectedMessageError{msgUserAuthSuccess, packet[0]} +} + +func (n *noneAuth) method() string { + return "none" +} + +// "password" authentication, RFC 4252 Section 8. +type passwordAuth struct { + ClientPassword +} + +func (p *passwordAuth) auth(user string, t *transport) (bool, []string, error) { + type passwordAuthMsg struct { + User string + Service string + Method string + Reply bool + Password string + } + + pw, err := p.Password(user) + if err != nil { + return false, nil, err + } + + if err := t.writePacket(marshal(msgUserAuthRequest, passwordAuthMsg{ + User: user, + Service: serviceSSH, + Method: "password", + Reply: false, + Password: pw, + })); err != nil { + return false, nil, err + } + + packet, err := t.readPacket() + if err != nil { + return false, nil, err + } + + switch packet[0] { + case msgUserAuthSuccess: + return true, nil, nil + case msgUserAuthFailure: + msg := decode(packet).(*userAuthFailureMsg) + return false, msg.Methods, nil + } + return false, nil, UnexpectedMessageError{msgUserAuthSuccess, packet[0]} +} + +func (p *passwordAuth) method() string { + return "password" +} + +// A ClientPassword implements access to a client's passwords. +type ClientPassword interface { + // Password returns the password to use for user. + Password(user string) (password string, err error) +} + +// ClientAuthPassword returns a ClientAuth using password authentication. +func ClientAuthPassword(impl ClientPassword) ClientAuth { + return &passwordAuth{impl} +} diff --git a/libgo/go/exp/ssh/common.go b/libgo/go/exp/ssh/common.go index f68c353a397..273820b6428 100644 --- a/libgo/go/exp/ssh/common.go +++ b/libgo/go/exp/ssh/common.go @@ -5,7 +5,7 @@ package ssh import ( - "big" + "math/big" "strconv" "sync" ) diff --git a/libgo/go/exp/ssh/doc.go b/libgo/go/exp/ssh/doc.go index fc842b0c1d2..248b2fec4f8 100644 --- a/libgo/go/exp/ssh/doc.go +++ b/libgo/go/exp/ssh/doc.go @@ -83,7 +83,7 @@ authentication method is supported. config := &ClientConfig{ User: "username", - Password: "123456", + Auth: []ClientAuth{ ... }, } client, err := Dial("yourserver.com:22", config) diff --git a/libgo/go/exp/ssh/messages.go b/libgo/go/exp/ssh/messages.go index 5eae181872a..e24b6398b56 100644 --- a/libgo/go/exp/ssh/messages.go +++ b/libgo/go/exp/ssh/messages.go @@ -5,9 +5,9 @@ package ssh import ( - "big" "bytes" "io" + "math/big" "reflect" ) diff --git a/libgo/go/exp/ssh/messages_test.go b/libgo/go/exp/ssh/messages_test.go index 629f3d3b145..fe4c397dc3a 100644 --- a/libgo/go/exp/ssh/messages_test.go +++ b/libgo/go/exp/ssh/messages_test.go @@ -5,8 +5,8 @@ package ssh import ( - "big" - "rand" + "math/big" + "math/rand" "reflect" "testing" "testing/quick" diff --git a/libgo/go/exp/ssh/server.go b/libgo/go/exp/ssh/server.go index 2ae8079d2db..62035d52b7d 100644 --- a/libgo/go/exp/ssh/server.go +++ b/libgo/go/exp/ssh/server.go @@ -5,7 +5,6 @@ package ssh import ( - "big" "bytes" "crypto" "crypto/rand" @@ -14,6 +13,7 @@ import ( "encoding/pem" "errors" "io" + "math/big" "net" "sync" ) diff --git a/libgo/go/exp/types/const.go b/libgo/go/exp/types/const.go index 1ef95d9f952..048f63bb7d3 100644 --- a/libgo/go/exp/types/const.go +++ b/libgo/go/exp/types/const.go @@ -7,8 +7,8 @@ package types import ( - "big" "go/token" + "math/big" "strconv" ) @@ -131,7 +131,7 @@ func (x Const) Match(y Const) (u, v Const) { // otherwise the result is invalid. func (x Const) Convert(typ *Type) Const { // TODO(gri) implement this - switch x := x.val.(type) { + switch x.val.(type) { case bool: case *big.Int: case *big.Rat: diff --git a/libgo/go/exp/types/gcimporter.go b/libgo/go/exp/types/gcimporter.go index 69dbd5ac5f3..4167caf3f0e 100644 --- a/libgo/go/exp/types/gcimporter.go +++ b/libgo/go/exp/types/gcimporter.go @@ -8,17 +8,17 @@ package types import ( - "big" "errors" "fmt" "go/ast" "go/token" "io" + "math/big" "os" "path/filepath" "runtime" - "scanner" "strconv" + "text/scanner" ) const trace = false // set to true for debugging diff --git a/libgo/go/exp/types/gcimporter_test.go b/libgo/go/exp/types/gcimporter_test.go index ec87f5d514b..3f66d226153 100644 --- a/libgo/go/exp/types/gcimporter_test.go +++ b/libgo/go/exp/types/gcimporter_test.go @@ -5,9 +5,9 @@ package types import ( - "exec" "go/ast" "io/ioutil" + "os/exec" "path/filepath" "runtime" "strings" diff --git a/libgo/go/exp/wingui/gui.go b/libgo/go/exp/wingui/gui.go index a2f16f282b1..5df2ee0faa1 100644 --- a/libgo/go/exp/wingui/gui.go +++ b/libgo/go/exp/wingui/gui.go @@ -6,8 +6,8 @@ package main import ( "fmt" - "syscall" "os" + "syscall" "unsafe" ) diff --git a/libgo/go/exp/wingui/winapi.go b/libgo/go/exp/wingui/winapi.go index 32015287c92..08059df2b9d 100644 --- a/libgo/go/exp/wingui/winapi.go +++ b/libgo/go/exp/wingui/winapi.go @@ -5,8 +5,8 @@ package main import ( - "unsafe" "syscall" + "unsafe" ) type Wndclassex struct { diff --git a/libgo/go/expvar/expvar.go b/libgo/go/expvar/expvar.go index f5d6ed586c8..629280acf76 100644 --- a/libgo/go/expvar/expvar.go +++ b/libgo/go/expvar/expvar.go @@ -23,10 +23,10 @@ package expvar import ( "bytes" + "encoding/json" "fmt" - "http" - "json" "log" + "net/http" "os" "runtime" "strconv" diff --git a/libgo/go/expvar/expvar_test.go b/libgo/go/expvar/expvar_test.go index 8f7a48168ea..fc607274b28 100644 --- a/libgo/go/expvar/expvar_test.go +++ b/libgo/go/expvar/expvar_test.go @@ -5,7 +5,7 @@ package expvar import ( - "json" + "encoding/json" "testing" ) diff --git a/libgo/go/fmt/format.go b/libgo/go/fmt/format.go index 80eb9863353..3957a5a261d 100644 --- a/libgo/go/fmt/format.go +++ b/libgo/go/fmt/format.go @@ -8,7 +8,7 @@ import ( "bytes" "strconv" "unicode" - "utf8" + "unicode/utf8" ) const ( diff --git a/libgo/go/fmt/print.go b/libgo/go/fmt/print.go index 13456445449..bfa88d18704 100644 --- a/libgo/go/fmt/print.go +++ b/libgo/go/fmt/print.go @@ -12,7 +12,7 @@ import ( "reflect" "sync" "unicode" - "utf8" + "unicode/utf8" ) // Some constants in the form of bytes, to avoid string overhead. diff --git a/libgo/go/fmt/scan.go b/libgo/go/fmt/scan.go index 54a9fe2951e..85571e80c7a 100644 --- a/libgo/go/fmt/scan.go +++ b/libgo/go/fmt/scan.go @@ -14,7 +14,7 @@ import ( "strconv" "strings" "unicode" - "utf8" + "unicode/utf8" ) // runeUnreader is the interface to something that can unread runes. @@ -219,7 +219,7 @@ func (s *ss) getRune() (r rune) { return } -// mustReadRune turns os.EOF into a panic(io.ErrUnexpectedEOF). +// mustReadRune turns io.EOF into a panic(io.ErrUnexpectedEOF). // It is called in cases such as string scanning where an EOF is a // syntax error. func (s *ss) mustReadRune() (r rune) { diff --git a/libgo/go/fmt/scan_test.go b/libgo/go/fmt/scan_test.go index 7dd0015b270..d3c39be6071 100644 --- a/libgo/go/fmt/scan_test.go +++ b/libgo/go/fmt/scan_test.go @@ -15,7 +15,7 @@ import ( "regexp" "strings" "testing" - "utf8" + "unicode/utf8" ) type ScanTest struct { diff --git a/libgo/go/go/ast/ast.go b/libgo/go/go/ast/ast.go index f8caafc179a..a0aa5ff1204 100644 --- a/libgo/go/go/ast/ast.go +++ b/libgo/go/go/ast/ast.go @@ -10,7 +10,7 @@ package ast import ( "go/token" "unicode" - "utf8" + "unicode/utf8" ) // ---------------------------------------------------------------------------- diff --git a/libgo/go/go/ast/import.go b/libgo/go/go/ast/import.go new file mode 100644 index 00000000000..894fecdaa7e --- /dev/null +++ b/libgo/go/go/ast/import.go @@ -0,0 +1,139 @@ +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package ast + +import ( + "go/token" + "sort" + "strconv" +) + +// SortImports sorts runs of consecutive import lines in import blocks in f. +func SortImports(fset *token.FileSet, f *File) { + for _, d := range f.Decls { + d, ok := d.(*GenDecl) + if !ok || d.Tok != token.IMPORT { + // Not an import declaration, so we're done. + // Imports are always first. + break + } + + if d.Lparen == token.NoPos { + // Not a block: sorted by default. + continue + } + + // Identify and sort runs of specs on successive lines. + i := 0 + for j, s := range d.Specs { + if j > i && fset.Position(s.Pos()).Line > 1+fset.Position(d.Specs[j-1].End()).Line { + // j begins a new run. End this one. + sortSpecs(fset, f, d.Specs[i:j]) + i = j + } + } + sortSpecs(fset, f, d.Specs[i:]) + } +} + +func importPath(s Spec) string { + t, err := strconv.Unquote(s.(*ImportSpec).Path.Value) + if err == nil { + return t + } + return "" +} + +type posSpan struct { + Start token.Pos + End token.Pos +} + +func sortSpecs(fset *token.FileSet, f *File, specs []Spec) { + // Avoid work if already sorted (also catches < 2 entries). + sorted := true + for i, s := range specs { + if i > 0 && importPath(specs[i-1]) > importPath(s) { + sorted = false + break + } + } + if sorted { + return + } + + // Record positions for specs. + pos := make([]posSpan, len(specs)) + for i, s := range specs { + // Cannot use s.End(), because it looks at len(s.Path.Value), + // and that string might have gotten longer or shorter. + // Instead, use s.Pos()+1, which is guaranteed to be > s.Pos() + // and still before the original end of the string, since any + // string literal must be at least 2 characters ("" or ``). + pos[i] = posSpan{s.Pos(), s.Pos() + 1} + } + + // Identify comments in this range. + // Any comment from pos[0].Start to the final line counts. + lastLine := fset.Position(pos[len(pos)-1].End).Line + cstart := len(f.Comments) + cend := len(f.Comments) + for i, g := range f.Comments { + if g.Pos() < pos[0].Start { + continue + } + if i < cstart { + cstart = i + } + if fset.Position(g.End()).Line > lastLine { + cend = i + break + } + } + comments := f.Comments[cstart:cend] + + // Assign each comment to the import spec preceding it. + importComment := map[*ImportSpec][]*CommentGroup{} + specIndex := 0 + for _, g := range comments { + for specIndex+1 < len(specs) && pos[specIndex+1].Start <= g.Pos() { + specIndex++ + } + s := specs[specIndex].(*ImportSpec) + importComment[s] = append(importComment[s], g) + } + + // Sort the import specs by import path. + // Reassign the import paths to have the same position sequence. + // Reassign each comment to abut the end of its spec. + // Sort the comments by new position. + sort.Sort(byImportPath(specs)) + for i, s := range specs { + s := s.(*ImportSpec) + if s.Name != nil { + s.Name.NamePos = pos[i].Start + } + s.Path.ValuePos = pos[i].Start + s.EndPos = pos[i].End + for _, g := range importComment[s] { + for _, c := range g.List { + c.Slash = pos[i].End + } + } + } + sort.Sort(byCommentPos(comments)) +} + +type byImportPath []Spec // slice of *ImportSpec + +func (x byImportPath) Len() int { return len(x) } +func (x byImportPath) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x byImportPath) Less(i, j int) bool { return importPath(x[i]) < importPath(x[j]) } + +type byCommentPos []*CommentGroup + +func (x byCommentPos) Len() int { return len(x) } +func (x byCommentPos) Swap(i, j int) { x[i], x[j] = x[j], x[i] } +func (x byCommentPos) Less(i, j int) bool { return x[i].Pos() < x[j].Pos() } diff --git a/libgo/go/go/build/build.go b/libgo/go/go/build/build.go index 282a508b3b0..e3de8d0fa7f 100644 --- a/libgo/go/go/build/build.go +++ b/libgo/go/go/build/build.go @@ -8,9 +8,9 @@ package build import ( "bytes" "errors" - "exec" "fmt" "os" + "os/exec" "path/filepath" "regexp" "runtime" diff --git a/libgo/go/go/build/build_test.go b/libgo/go/go/build/build_test.go index 398e31ce26f..db8bc6c8a59 100644 --- a/libgo/go/go/build/build_test.go +++ b/libgo/go/go/build/build_test.go @@ -5,7 +5,7 @@ package build import ( - "exec" + "os/exec" "path/filepath" "reflect" "runtime" diff --git a/libgo/go/go/doc/comment.go b/libgo/go/go/doc/comment.go index e1989226b68..19216f85b96 100644 --- a/libgo/go/go/doc/comment.go +++ b/libgo/go/go/doc/comment.go @@ -11,7 +11,7 @@ import ( "io" "regexp" "strings" - "template" // for HTMLEscape + "text/template" // for HTMLEscape ) func isWhitespace(ch byte) bool { return ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r' } diff --git a/libgo/go/go/doc/example.go b/libgo/go/go/doc/example.go index 7fdf0bcff66..196c957544a 100644 --- a/libgo/go/go/doc/example.go +++ b/libgo/go/go/doc/example.go @@ -10,7 +10,7 @@ import ( "go/ast" "strings" "unicode" - "utf8" + "unicode/utf8" ) type Example struct { diff --git a/libgo/go/go/parser/parser.go b/libgo/go/go/parser/parser.go index e2c94413721..55b8998b7d5 100644 --- a/libgo/go/go/parser/parser.go +++ b/libgo/go/go/parser/parser.go @@ -1131,7 +1131,7 @@ func (p *parser) parseLiteralValue(typ ast.Expr) ast.Expr { // checkExpr checks that x is an expression (and not a type). func (p *parser) checkExpr(x ast.Expr) ast.Expr { - switch t := unparen(x).(type) { + switch unparen(x).(type) { case *ast.BadExpr: case *ast.Ident: case *ast.BasicLit: diff --git a/libgo/go/go/printer/printer.go b/libgo/go/go/printer/printer.go index 8f1ed1159df..aba7d93a64b 100644 --- a/libgo/go/go/printer/printer.go +++ b/libgo/go/go/printer/printer.go @@ -13,7 +13,7 @@ import ( "io" "os" "path/filepath" - "tabwriter" + "text/tabwriter" ) const debug = false // enable for debugging diff --git a/libgo/go/go/scanner/scanner.go b/libgo/go/go/scanner/scanner.go index dfbdaa3a125..cef9c486508 100644 --- a/libgo/go/go/scanner/scanner.go +++ b/libgo/go/go/scanner/scanner.go @@ -27,7 +27,7 @@ import ( "path/filepath" "strconv" "unicode" - "utf8" + "unicode/utf8" ) // A Scanner holds the scanner's internal state while processing diff --git a/libgo/go/go/token/serialize.go b/libgo/go/go/token/serialize.go index 611b1b3be9d..042d6abdf9d 100644 --- a/libgo/go/go/token/serialize.go +++ b/libgo/go/go/token/serialize.go @@ -5,7 +5,7 @@ package token import ( - "gob" + "encoding/gob" "io" ) diff --git a/libgo/go/html/doc.go b/libgo/go/html/doc.go index ba9d188486f..1bea690c2c8 100644 --- a/libgo/go/html/doc.go +++ b/libgo/go/html/doc.go @@ -36,7 +36,7 @@ lower-cased, and attributes are collected into a []Attribute. For example: for { if z.Next() == html.ErrorToken { - // Returning os.EOF indicates success. + // Returning io.EOF indicates success. return z.Error() } emitToken(z.Token()) @@ -61,7 +61,7 @@ call to Next. For example, to extract an HTML page's anchor text: case StartTagToken, EndTagToken: tn, _ := z.TagName() if len(tn) == 1 && tn[0] == 'a' { - if tt == StartTag { + if tt == StartTagToken { depth++ } else { depth-- diff --git a/libgo/go/html/entity_test.go b/libgo/go/html/entity_test.go index 2cf49d61d2d..b53f866fa2d 100644 --- a/libgo/go/html/entity_test.go +++ b/libgo/go/html/entity_test.go @@ -6,7 +6,7 @@ package html import ( "testing" - "utf8" + "unicode/utf8" ) func TestEntityLength(t *testing.T) { diff --git a/libgo/go/html/escape.go b/libgo/go/html/escape.go index b8e6571a292..ac9e100df0c 100644 --- a/libgo/go/html/escape.go +++ b/libgo/go/html/escape.go @@ -7,7 +7,7 @@ package html import ( "bytes" "strings" - "utf8" + "unicode/utf8" ) // These replacements permit compatibility with old numeric entities that diff --git a/libgo/go/html/parse.go b/libgo/go/html/parse.go index c9f016588d0..f47d4ea147c 100644 --- a/libgo/go/html/parse.go +++ b/libgo/go/html/parse.go @@ -250,7 +250,7 @@ func (p *parser) read() error { p.tok = p.tokenizer.Token() switch p.tok.Type { case ErrorToken: - return p.tokenizer.Error() + return p.tokenizer.Err() case SelfClosingTagToken: p.hasSelfClosingToken = true p.tok.Type = StartTagToken @@ -275,7 +275,9 @@ type insertionMode func(*parser) (insertionMode, bool) // Section 11.2.3.1, "using the rules for". func useTheRulesFor(p *parser, actual, delegate insertionMode) (insertionMode, bool) { im, consumed := delegate(p) - // TODO: do we need to update p.originalMode if it equals delegate? + if p.originalIM == delegate { + p.originalIM = actual + } if im != delegate { return im, consumed } @@ -427,6 +429,7 @@ func beforeHeadIM(p *parser) (insertionMode, bool) { } if add || implied { p.addElement("head", attr) + p.head = p.top() } return inHeadIM, !implied } @@ -455,8 +458,10 @@ func inHeadIM(p *parser) (insertionMode, bool) { implied = true case StartTagToken: switch p.tok.Data { - case "meta": - // TODO. + case "base", "basefont", "bgsound", "command", "link", "meta": + p.addElement(p.tok.Data, p.tok.Attr) + p.oe.pop() + p.acknowledgeSelfClosingTag() case "script", "title", "noscript", "noframes", "style": p.addElement(p.tok.Data, p.tok.Attr) p.setOriginalIM(inHeadIM) @@ -509,7 +514,9 @@ func afterHeadIM(p *parser) (insertionMode, bool) { case "frameset": // TODO. case "base", "basefont", "bgsound", "link", "meta", "noframes", "script", "style", "title": - // TODO. + p.oe = append(p.oe, p.head) + defer p.oe.pop() + return useTheRulesFor(p, afterHeadIM, inHeadIM) case "head": // TODO. default: @@ -532,6 +539,23 @@ func afterHeadIM(p *parser) (insertionMode, bool) { return inBodyIM, !implied } +// copyAttributes copies attributes of src not found on dst to dst. +func copyAttributes(dst *Node, src Token) { + if len(src.Attr) == 0 { + return + } + attr := map[string]string{} + for _, a := range dst.Attr { + attr[a.Key] = a.Val + } + for _, a := range src.Attr { + if _, ok := attr[a.Key]; !ok { + dst.Attr = append(dst.Attr, a) + attr[a.Key] = a.Val + } + } +} + // Section 11.2.5.4.7. func inBodyIM(p *parser) (insertionMode, bool) { switch p.tok.Type { @@ -617,6 +641,19 @@ func inBodyIM(p *parser) (insertionMode, bool) { } p.reconstructActiveFormattingElements() p.addElement(p.tok.Data, p.tok.Attr) + case "body": + if len(p.oe) >= 2 { + body := p.oe[1] + if body.Type == ElementNode && body.Data == "body" { + p.framesetOK = false + copyAttributes(body, p.tok) + } + } + case "base", "basefont", "bgsound", "command", "link", "meta", "noframes", "script", "style", "title": + return useTheRulesFor(p, inBodyIM, inHeadIM) + case "image": + p.tok.Data = "img" + return inBodyIM, false default: // TODO. p.addElement(p.tok.Data, p.tok.Attr) @@ -635,6 +672,10 @@ func inBodyIM(p *parser) (insertionMode, bool) { p.inBodyEndTagFormatting(p.tok.Data) case "address", "article", "aside", "blockquote", "button", "center", "details", "dir", "div", "dl", "fieldset", "figcaption", "figure", "footer", "header", "hgroup", "listing", "menu", "nav", "ol", "pre", "section", "summary", "ul": p.popUntil(defaultScopeStopTags, p.tok.Data) + case "applet", "marquee", "object": + if p.popUntil(defaultScopeStopTags, p.tok.Data) { + p.clearActiveFormattingElements() + } default: p.inBodyEndTagOther(p.tok.Data) } @@ -934,22 +975,27 @@ func inRowIM(p *parser) (insertionMode, bool) { case StartTagToken: switch p.tok.Data { case "td", "th": - // TODO: clear the stack back to a table row context. + p.clearStackToContext(tableRowContextStopTags) p.addElement(p.tok.Data, p.tok.Attr) p.afe = append(p.afe, &scopeMarker) return inCellIM, true + case "caption", "col", "colgroup", "tbody", "tfoot", "thead", "tr": + if p.popUntil(tableScopeStopTags, "tr") { + return inTableBodyIM, false + } + // Ignore the token. + return inRowIM, true default: // TODO. } case EndTagToken: switch p.tok.Data { case "tr": - if !p.elementInScope(tableScopeStopTags, "tr") { - return inRowIM, true + if p.popUntil(tableScopeStopTags, "tr") { + return inTableBodyIM, true } - p.clearStackToContext(tableRowContextStopTags) - p.oe.pop() - return inTableBodyIM, true + // Ignore the token. + return inRowIM, true case "table": if p.popUntil(tableScopeStopTags, "tr") { return inTableBodyIM, false diff --git a/libgo/go/html/parse_test.go b/libgo/go/html/parse_test.go index 3fa40374eae..27979225b33 100644 --- a/libgo/go/html/parse_test.go +++ b/libgo/go/html/parse_test.go @@ -23,6 +23,7 @@ func pipeErr(err error) io.Reader { } func readDat(filename string, c chan io.Reader) { + defer close(c) f, err := os.Open("testdata/webkit/" + filename) if err != nil { c <- pipeErr(err) @@ -125,17 +126,27 @@ func dump(n *Node) (string, error) { } func TestParser(t *testing.T) { - // TODO(nigeltao): Process all the .dat files, not just the first one. - filenames := []string{ - "tests1.dat", + testFiles := []struct { + filename string + // n is the number of test cases to run from that file. + // -1 means all test cases. + n int + }{ + // TODO(nigeltao): Process all the test cases from all the .dat files. + {"tests1.dat", 92}, + {"tests2.dat", 0}, + {"tests3.dat", 0}, } - for _, filename := range filenames { + for _, tf := range testFiles { rc := make(chan io.Reader) - go readDat(filename, rc) - // TODO(nigeltao): Process all test cases, not just a subset. - for i := 0; i < 80; i++ { + go readDat(tf.filename, rc) + for i := 0; i != tf.n; i++ { // Parse the #data section. - b, err := ioutil.ReadAll(<-rc) + dataReader := <-rc + if dataReader == nil { + break + } + b, err := ioutil.ReadAll(dataReader) if err != nil { t.Fatal(err) } @@ -158,7 +169,7 @@ func TestParser(t *testing.T) { t.Fatal(err) } if want := string(b); got != want { - t.Errorf("%s test #%d %q, got vs want:\n----\n%s----\n%s----", filename, i, text, got, want) + t.Errorf("%s test #%d %q, got vs want:\n----\n%s----\n%s----", tf.filename, i, text, got, want) continue } if renderTestBlacklist[text] { @@ -178,10 +189,16 @@ func TestParser(t *testing.T) { t.Fatal(err) } if got != got1 { - t.Errorf("%s test #%d %q, got vs got1:\n----\n%s----\n%s----", filename, i, text, got, got1) + t.Errorf("%s test #%d %q, got vs got1:\n----\n%s----\n%s----", tf.filename, i, text, got, got1) continue } } + // Drain any untested cases for the test file. + for r := range rc { + if _, err := ioutil.ReadAll(r); err != nil { + t.Fatal(err) + } + } } } @@ -193,6 +210,7 @@ var renderTestBlacklist = map[string]bool{ // The second will be reparented to the first 's parent. This // results in an whose parent is an , which is not 'well-formed'. `
XCY`: true, - // The second will be reparented, similar to the case above. + // More cases of being reparented: `ababrx
aoe`: true, + `

`: true, } diff --git a/libgo/go/exp/template/html/attr.go b/libgo/go/html/template/attr.go similarity index 99% rename from libgo/go/exp/template/html/attr.go rename to libgo/go/html/template/attr.go index 6a36c7b7181..3ea02880d45 100644 --- a/libgo/go/exp/template/html/attr.go +++ b/libgo/go/html/template/attr.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "strings" diff --git a/libgo/go/exp/template/html/clone.go b/libgo/go/html/template/clone.go similarity index 98% rename from libgo/go/exp/template/html/clone.go rename to libgo/go/html/template/clone.go index 803a64de12f..d0d8ea46733 100644 --- a/libgo/go/exp/template/html/clone.go +++ b/libgo/go/html/template/clone.go @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( - "template/parse" + "text/template/parse" ) // clone clones a template Node. diff --git a/libgo/go/exp/template/html/clone_test.go b/libgo/go/html/template/clone_test.go similarity index 96% rename from libgo/go/exp/template/html/clone_test.go rename to libgo/go/html/template/clone_test.go index d91542529b9..ed1698acd8b 100644 --- a/libgo/go/exp/template/html/clone_test.go +++ b/libgo/go/html/template/clone_test.go @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "bytes" - "template" - "template/parse" "testing" + "text/template" + "text/template/parse" ) func TestClone(t *testing.T) { @@ -56,7 +56,7 @@ func TestClone(t *testing.T) { t.Errorf("want %q, got %q", want, got) } - d, err := Escape(d) + err := escape(d) if err != nil { t.Errorf("%q: failed to escape: %s", test.input, err) continue diff --git a/libgo/go/exp/template/html/content.go b/libgo/go/html/template/content.go similarity index 99% rename from libgo/go/exp/template/html/content.go rename to libgo/go/html/template/content.go index dcaff8c15c6..d720d4ba689 100644 --- a/libgo/go/exp/template/html/content.go +++ b/libgo/go/html/template/content.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "fmt" diff --git a/libgo/go/exp/template/html/content_test.go b/libgo/go/html/template/content_test.go similarity index 98% rename from libgo/go/exp/template/html/content_test.go rename to libgo/go/html/template/content_test.go index 033dee1747c..c96a521a59c 100644 --- a/libgo/go/exp/template/html/content_test.go +++ b/libgo/go/html/template/content_test.go @@ -2,12 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "bytes" "strings" - "template" "testing" ) @@ -203,7 +202,7 @@ func TestTypedContent(t *testing.T) { } for _, test := range tests { - tmpl := template.Must(Escape(template.Must(template.New("x").Parse(test.input)))) + tmpl := Must(New("x").Parse(test.input)) pre := strings.Index(test.input, "{{.}}") post := len(test.input) - (pre + 5) var b bytes.Buffer diff --git a/libgo/go/exp/template/html/context.go b/libgo/go/html/template/context.go similarity index 99% rename from libgo/go/exp/template/html/context.go rename to libgo/go/html/template/context.go index c44df4debc1..7202221b831 100644 --- a/libgo/go/exp/template/html/context.go +++ b/libgo/go/html/template/context.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "fmt" diff --git a/libgo/go/exp/template/html/css.go b/libgo/go/html/template/css.go similarity index 99% rename from libgo/go/exp/template/html/css.go rename to libgo/go/html/template/css.go index c26ae78d17f..b0a2f013d29 100644 --- a/libgo/go/exp/template/html/css.go +++ b/libgo/go/html/template/css.go @@ -2,13 +2,13 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "bytes" "fmt" "unicode" - "utf8" + "unicode/utf8" ) // endsWithCSSKeyword returns whether b ends with an ident that diff --git a/libgo/go/exp/template/html/css_test.go b/libgo/go/html/template/css_test.go similarity index 99% rename from libgo/go/exp/template/html/css_test.go rename to libgo/go/html/template/css_test.go index b3b83e855d3..0d94bdcf18c 100644 --- a/libgo/go/exp/template/html/css_test.go +++ b/libgo/go/html/template/css_test.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "strconv" diff --git a/libgo/go/exp/template/html/doc.go b/libgo/go/html/template/doc.go similarity index 71% rename from libgo/go/exp/template/html/doc.go rename to libgo/go/html/template/doc.go index a9b78ca5157..0324c9c0ee3 100644 --- a/libgo/go/exp/template/html/doc.go +++ b/libgo/go/html/template/doc.go @@ -3,65 +3,61 @@ // license that can be found in the LICENSE file. /* -Package html is a specialization of package template that automates the -construction of HTML output that is safe against code injection. +Package template (html/template) is a specialization of package text/template +that automates the construction of HTML output that is safe against code +injection. Introduction -To use this package, invoke the standard template package to parse a template -set, and then use this package’s EscapeSet function to secure the set. -The arguments to EscapeSet are the template set and the names of all templates -that will be passed to Execute. +This package wraps package template so you can use the standard template API +to parse and execute templates. set, err := new(template.Set).Parse(...) - set, err = EscapeSet(set, "templateName0", ...) + // Error checking elided + err = set.Execute(out, "Foo", data) -If successful, set will now be injection-safe. Otherwise, the returned set will -be nil and an error, described below, will explain the problem. +If successful, set will now be injection-safe. Otherwise, err is an error +defined in the docs for ErrorCode. -The template names do not need to include helper templates but should include -all names x used thus: - - set.Execute(out, x, ...) - -EscapeSet modifies the named templates in place to treat data values as plain -text safe for embedding in an HTML document. The escaping is contextual, so -actions can appear within JavaScript, CSS, and URI contexts without introducing'hazards. +HTML templates treat data values as plain text which should be encoded so they +can be safely embedded in an HTML document. The escaping is contextual, so +actions can appear within JavaScript, CSS, and URI contexts. The security model used by this package assumes that template authors are trusted, while Execute's data parameter is not. More details are provided below. Example - tmpls, err := new(template.Set).Parse(`{{define "t'}}Hello, {{.}}!{{end}}`) - -when used by itself - - tmpls.Execute(out, "t", "") + import "template" + ... + t, err := (&template.Set{}).Parse(`{{define "T"}}Hello, {{.}}!{{end}}`) + err = t.Execute(out, "T", "") produces Hello, ! -but after securing with EscapeSet like this, +but with contextual autoescaping, - tmpls, err := EscapeSet(tmpls, "t") - tmpls.Execute(out, "t", ...) + import "html/template" + ... + t, err := (&template.Set{}).Parse(`{{define "T"}}Hello, {{.}}!{{end}}`) + err = t.Execute(out, "T", "") -produces the safe, escaped HTML output +produces safe, escaped HTML output Hello, <script>alert('you have been pwned')</script>! Contexts -EscapeSet understands HTML, CSS, JavaScript, and URIs. It adds sanitizing +This package understands HTML, CSS, JavaScript, and URIs. It adds sanitizing functions to each simple action pipeline, so given the excerpt {{.}} -EscapeSet will rewrite each {{.}} to add escaping functions where necessary, +At parse time each {{.}} is overwritten to add escaping functions as necessary, in this case, {{. | html}} @@ -134,8 +130,8 @@ embedding in JavaScript contexts. Typed Strings -By default, EscapeSet assumes all pipelines produce a plain text string. It -adds escaping pipeline stages necessary to correctly and safely embed that +By default, this package assumes that all pipelines produce a plain text string. +It adds escaping pipeline stages necessary to correctly and safely embed that plain text string in the appropriate context. When a data value is not plain text, you can make sure it is not over-escaped @@ -183,8 +179,8 @@ injecting the template output into a page and all code specified by the template author should run as a result of the same." Least Surprise Property -"A developer (or code reviewer) familiar with HTML, CSS, and JavaScript; -who knows that EscapeSet is applied should be able to look at a {{.}} +"A developer (or code reviewer) familiar with HTML, CSS, and JavaScript, who +knows that contextual autoescaping happens should be able to look at a {{.}} and correctly infer what sanitization happens." */ -package html +package template diff --git a/libgo/go/exp/template/html/error.go b/libgo/go/html/template/error.go similarity index 75% rename from libgo/go/exp/template/html/error.go rename to libgo/go/html/template/error.go index 22fca9e060e..9622d7e48ee 100644 --- a/libgo/go/exp/template/html/error.go +++ b/libgo/go/html/template/error.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "fmt" @@ -75,12 +75,12 @@ const ( // Example: // {{if .C}} // {{end}} // {{define "helper"}} document.write('
{{end}} // {{define "attrs"}}href="{{.URL}}"{{end}} // Discussion: - // EscapeSet looks through template calls to compute the context. + // Package html/template looks through template calls to compute the + // context. // Here the {{.URL}} in "attrs" must be treated as a URL when called - // from "main", but if "attrs" is not in set when - // EscapeSet(&set, "main") is called, this error will arise. + // from "main", but you will get this error if "attrs" is not defined + // when "main" is parsed. ErrNoSuchTemplate // ErrOutputContext: "cannot compute output context for template ..." @@ -151,17 +135,18 @@ const ( // Example: // // Discussion: - // EscapeSet does not support interpolation into regular expression - // literal character sets. + // Package html/template does not support interpolation into regular + // expression literal character sets. ErrPartialCharset // ErrPartialEscape: "unfinished escape sequence in ..." // Example: // // Discussion: - // EscapeSet does not support actions following a backslash. + // Package html/template does not support actions following a + // backslash. // This is usually an error and there are better solutions; for - // our example + // example // // should work, and if {{.X}} is a partial escape sequence such as // "xA0", mark the whole sequence as safe content: JSStr(`\xA0`) @@ -169,16 +154,15 @@ const ( // ErrRangeLoopReentry: "on range loop re-entry: ..." // Example: - // {{range .}}

var x = [{{range .}}'{{.}},{{end}}] // Discussion: // If an iteration through a range would cause it to end in a // different context than an earlier pass, there is no single context. - // In the example, the

tag is missing a '>'. - // EscapeSet cannot tell whether {{.}} is meant to be an HTML class or - // the content of a broken

element and complains because the - // second iteration would produce something like + // In the example, there is missing a quote, so it is not clear + // whether {{.}} is meant to be inside a JS string or in a JS value + // context. The second iteration would produce something like // - //

var x = ['firstValue,'secondValue] ErrRangeLoopReentry // ErrSlashAmbig: '/' could start a division or regexp. diff --git a/libgo/go/exp/template/html/escape.go b/libgo/go/html/template/escape.go similarity index 96% rename from libgo/go/exp/template/html/escape.go rename to libgo/go/html/template/escape.go index 28615a93180..8ac07eae24c 100644 --- a/libgo/go/exp/template/html/escape.go +++ b/libgo/go/html/template/escape.go @@ -2,41 +2,33 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -package html +package template import ( "bytes" "fmt" "html" - "template" - "template/parse" + "text/template" + "text/template/parse" ) -// Escape rewrites each action in the template to guarantee that the output is +// escape rewrites each action in the template to guarantee that the output is // properly escaped. -func Escape(t *template.Template) (*template.Template, error) { +func escape(t *template.Template) error { var s template.Set s.Add(t) - if _, err := EscapeSet(&s, t.Name()); err != nil { - return nil, err - } + return escapeSet(&s, t.Name()) // TODO: if s contains cloned dependencies due to self-recursion // cross-context, error out. - return t, nil } -// EscapeSet rewrites the template set to guarantee that the output of any of +// escapeSet rewrites the template set to guarantee that the output of any of // the named templates is properly escaped. // Names should include the names of all templates that might be Executed but // need not include helper templates. // If no error is returned, then the named templates have been modified. // Otherwise the named templates have been rendered unusable. -func EscapeSet(s *template.Set, names ...string) (*template.Set, error) { - if len(names) == 0 { - // TODO: Maybe add a method to Set to enumerate template names - // and use those instead. - return nil, &Error{ErrNoNames, "", 0, "must specify names of top level templates"} - } +func escapeSet(s *template.Set, names ...string) error { e := newEscaper(s) for _, name := range names { c, _ := e.escapeTree(context{}, name, 0) @@ -53,11 +45,11 @@ func EscapeSet(s *template.Set, names ...string) (*template.Set, error) { t.Tree = nil } } - return nil, err + return err } } e.commit() - return s, nil + return nil } // funcMap maps command names to functions that render their inputs safe. @@ -509,7 +501,7 @@ func (e *escaper) escapeTree(c context, name string, line int) (context, string) }, dname } if dname != name { - // Use any template derived during an earlier call to EscapeSet + // Use any template derived during an earlier call to escapeSet // with different top level templates, or clone if necessary. dt := e.template(dname) if dt == nil { @@ -675,7 +667,7 @@ func contextAfterText(c context, s []byte) (context, int) { // http://www.w3.org/TR/html5/tokenization.html#attribute-value-unquoted-state // lists the runes below as error characters. // Error out because HTML parsers may differ on whether - // "`, - `