diff options
83 files changed, 45 insertions, 159 deletions
diff --git a/src/cmd/ebnflint/ebnflint.go b/src/cmd/ebnflint/ebnflint.go index 762815972..606961e7d 100644 --- a/src/cmd/ebnflint/ebnflint.go +++ b/src/cmd/ebnflint/ebnflint.go @@ -13,7 +13,6 @@ import ( "io"; "os"; "path"; - "sort"; "strings"; ) @@ -47,7 +46,7 @@ func extractEBNF(src []byte) []byte { i += len(open); // write as many newlines as found in the excluded text - // to maintain correct line numbers in error messages + // to maintain correct line numbers in error messages for _, ch := range src[0 : i] { if ch == '\n' { buf.WriteByte('\n'); diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index 36e66a211..5164c39c2 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -40,13 +40,11 @@ import ( "http"; "io"; "log"; - "net"; "os"; pathutil "path"; "sort"; "strings"; "sync"; - "syscall"; "template"; "time"; ) diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go index 53fe46d24..9442957a9 100644 --- a/src/cmd/gofmt/gofmt.go +++ b/src/cmd/gofmt/gofmt.go @@ -11,10 +11,8 @@ import ( "go/parser"; "go/printer"; "go/scanner"; - "io"; "os"; pathutil "path"; - "sort"; "strings"; ) diff --git a/src/cmd/gotest/gotest b/src/cmd/gotest/gotest index e07932b52..5ee3eb0a8 100755 --- a/src/cmd/gotest/gotest +++ b/src/cmd/gotest/gotest @@ -86,11 +86,23 @@ MAKELEVEL= importpath=$(make -s importpath) { + # test functions are named TestFoo + # the grep -v eliminates methods and other special names + # that have multiple dots. + pattern='Test([^a-z].*)?' + tests=$(6nm -s _test/$importpath.a $xofile | egrep ' T .*·'$pattern'$' | grep -v '·.*[.·]' | sed 's/.* //; s/·/./') + if [ "x$tests" = x ]; then + echo 'gotest: error: no tests matching '$pattern in _test/$importpath.a $xofile 1>&2 + exit 2 + fi + # package spec echo 'package main' echo # imports - echo 'import "'$importpath'"' + if echo "$tests" | egrep -v '_test\.' >/dev/null; then + echo 'import "'$importpath'"' + fi if $havex; then echo 'import "./_xtest_"' fi @@ -98,20 +110,10 @@ importpath=$(make -s importpath) # test array echo echo 'var tests = []testing.Test {' - - # test functions are named TestFoo - # the grep -v eliminates methods and other special names - # that have multiple dots. - pattern='Test([^a-z].*)?' - tests=$(6nm -s _test/$importpath.a $xofile | egrep ' T .*·'$pattern'$' | grep -v '·.*[.·]' | sed 's/.* //; s/·/./') - if [ "x$tests" = x ]; then - echo 'gotest: warning: no tests matching '$pattern in _test/$importpath.a $xofile 1>&2 - else - for i in $tests - do - echo ' testing.Test{ "'$i'", '$i' },' - done - fi + for i in $tests + do + echo ' testing.Test{ "'$i'", '$i' },' + done echo '}' # body echo diff --git a/src/pkg/archive/tar/reader_test.go b/src/pkg/archive/tar/reader_test.go index 4e546cebd..85bfef170 100644 --- a/src/pkg/archive/tar/reader_test.go +++ b/src/pkg/archive/tar/reader_test.go @@ -6,7 +6,6 @@ package tar import ( "bytes"; - "fmt"; "io"; "os"; "reflect"; diff --git a/src/pkg/archive/tar/writer_test.go b/src/pkg/archive/tar/writer_test.go index 40b78bb32..69f069ff3 100644 --- a/src/pkg/archive/tar/writer_test.go +++ b/src/pkg/archive/tar/writer_test.go @@ -8,9 +8,6 @@ import ( "bytes"; "fmt"; "io"; - "os"; - "reflect"; - "strings"; "testing"; ) diff --git a/src/pkg/compress/flate/flate_test.go b/src/pkg/compress/flate/flate_test.go index 01d875c0a..2d1255f3c 100644 --- a/src/pkg/compress/flate/flate_test.go +++ b/src/pkg/compress/flate/flate_test.go @@ -10,11 +10,7 @@ package flate import ( "bytes"; - "bufio"; - "io"; - "os"; "reflect"; - "strconv"; "testing"; ) diff --git a/src/pkg/compress/gzip/gunzip_test.go b/src/pkg/compress/gzip/gunzip_test.go index aef79244d..99e9a75d6 100644 --- a/src/pkg/compress/gzip/gunzip_test.go +++ b/src/pkg/compress/gzip/gunzip_test.go @@ -6,7 +6,6 @@ package gzip import ( "bytes"; - "fmt"; "io"; "os"; "testing"; diff --git a/src/pkg/crypto/aes/aes_test.go b/src/pkg/crypto/aes/aes_test.go index 95e43f117..b2e0c7bb5 100644 --- a/src/pkg/crypto/aes/aes_test.go +++ b/src/pkg/crypto/aes/aes_test.go @@ -5,7 +5,6 @@ package aes import ( - "fmt"; "testing"; ) diff --git a/src/pkg/crypto/block/cbc_aes_test.go b/src/pkg/crypto/block/cbc_aes_test.go index 8f7d5b442..23cf21a5f 100644 --- a/src/pkg/crypto/block/cbc_aes_test.go +++ b/src/pkg/crypto/block/cbc_aes_test.go @@ -14,7 +14,6 @@ import ( "bytes"; "crypto/aes"; "io"; - "os"; "testing"; ) diff --git a/src/pkg/crypto/block/cfb_aes_test.go b/src/pkg/crypto/block/cfb_aes_test.go index ce8627ed0..6e948d33d 100644 --- a/src/pkg/crypto/block/cfb_aes_test.go +++ b/src/pkg/crypto/block/cfb_aes_test.go @@ -14,7 +14,6 @@ import ( "bytes"; "crypto/aes"; "io"; - "os"; "testing"; ) diff --git a/src/pkg/crypto/block/cmac.go b/src/pkg/crypto/block/cmac.go index b567f0e56..112dcc238 100644 --- a/src/pkg/crypto/block/cmac.go +++ b/src/pkg/crypto/block/cmac.go @@ -7,10 +7,7 @@ package block -import ( - "io"; - "os"; -) +import "os" const ( // minimal irreducible polynomial of degree b diff --git a/src/pkg/crypto/block/ctr_aes_test.go b/src/pkg/crypto/block/ctr_aes_test.go index d9c9c4b2f..2e800fe16 100644 --- a/src/pkg/crypto/block/ctr_aes_test.go +++ b/src/pkg/crypto/block/ctr_aes_test.go @@ -14,7 +14,6 @@ import ( "bytes"; "crypto/aes"; "io"; - "os"; "testing"; ) diff --git a/src/pkg/crypto/block/ecb_aes_test.go b/src/pkg/crypto/block/ecb_aes_test.go index 65f093d84..f823d2fe2 100644 --- a/src/pkg/crypto/block/ecb_aes_test.go +++ b/src/pkg/crypto/block/ecb_aes_test.go @@ -14,7 +14,6 @@ import ( "bytes"; "crypto/aes"; "io"; - "os"; "testing"; ) diff --git a/src/pkg/crypto/block/ofb_aes_test.go b/src/pkg/crypto/block/ofb_aes_test.go index d9a109279..85d32bd72 100644 --- a/src/pkg/crypto/block/ofb_aes_test.go +++ b/src/pkg/crypto/block/ofb_aes_test.go @@ -14,7 +14,6 @@ import ( "bytes"; "crypto/aes"; "io"; - "os"; "testing"; ) diff --git a/src/pkg/datafmt/datafmt.go b/src/pkg/datafmt/datafmt.go index 8918d5e97..7f245694e 100644 --- a/src/pkg/datafmt/datafmt.go +++ b/src/pkg/datafmt/datafmt.go @@ -203,15 +203,12 @@ package datafmt import ( "bytes"; - "container/vector"; "fmt"; "go/token"; "io"; "os"; "reflect"; "runtime"; - "strconv"; - "strings"; ) diff --git a/src/pkg/datafmt/datafmt_test.go b/src/pkg/datafmt/datafmt_test.go index e1355dd36..949f3551f 100644 --- a/src/pkg/datafmt/datafmt_test.go +++ b/src/pkg/datafmt/datafmt_test.go @@ -6,7 +6,6 @@ package datafmt import ( "fmt"; - "os"; "strings"; "testing"; ) diff --git a/src/pkg/datafmt/parser.go b/src/pkg/datafmt/parser.go index d1fa3f2cb..545899132 100644 --- a/src/pkg/datafmt/parser.go +++ b/src/pkg/datafmt/parser.go @@ -6,7 +6,6 @@ package datafmt import ( "container/vector"; - "fmt"; "go/scanner"; "go/token"; "os"; diff --git a/src/pkg/debug/dwarf/entry.go b/src/pkg/debug/dwarf/entry.go index 98a8b2ea0..986e098a8 100644 --- a/src/pkg/debug/dwarf/entry.go +++ b/src/pkg/debug/dwarf/entry.go @@ -10,10 +10,7 @@ package dwarf -import ( - "os"; - "strconv"; -) +import "os" // a single entry's description: a sequence of attributes type abbrev struct { diff --git a/src/pkg/debug/dwarf/open.go b/src/pkg/debug/dwarf/open.go index e252ce5f4..15d0b6ea6 100644 --- a/src/pkg/debug/dwarf/open.go +++ b/src/pkg/debug/dwarf/open.go @@ -9,7 +9,6 @@ package dwarf import ( "debug/binary"; - "fmt"; "os"; ) diff --git a/src/pkg/debug/gosym/pclntab.go b/src/pkg/debug/gosym/pclntab.go index b687cccf2..ee6359f9d 100644 --- a/src/pkg/debug/gosym/pclntab.go +++ b/src/pkg/debug/gosym/pclntab.go @@ -8,10 +8,7 @@ package gosym -import ( - "debug/binary"; - "io"; -) +import "debug/binary" type LineTable struct { Data []byte; diff --git a/src/pkg/debug/gosym/pclntab_test.go b/src/pkg/debug/gosym/pclntab_test.go index 9a32d050c..4345112cc 100644 --- a/src/pkg/debug/gosym/pclntab_test.go +++ b/src/pkg/debug/gosym/pclntab_test.go @@ -6,8 +6,6 @@ package gosym import ( "debug/elf"; - "exec"; - "io"; "os"; "testing"; "syscall"; diff --git a/src/pkg/debug/proc/proc.go b/src/pkg/debug/proc/proc.go index e8c62f22b..c67e02fea 100644 --- a/src/pkg/debug/proc/proc.go +++ b/src/pkg/debug/proc/proc.go @@ -13,15 +13,15 @@ package proc // and proc_darwin.go do, because deps.bash only looks at // this file. import ( - "container/vector"; - "fmt"; - "io"; + _ "container/vector"; + _ "fmt"; + _ "io"; "os"; - "runtime"; + _ "runtime"; "strconv"; - "strings"; - "sync"; - "syscall"; + _ "strings"; + _ "sync"; + _ "syscall"; ) type Word uint64 diff --git a/src/pkg/ebnf/ebnf.go b/src/pkg/ebnf/ebnf.go index f71ccc72b..ad630fca5 100644 --- a/src/pkg/ebnf/ebnf.go +++ b/src/pkg/ebnf/ebnf.go @@ -24,12 +24,9 @@ package ebnf import ( "container/vector"; - "fmt"; "go/scanner"; "go/token"; "os"; - "strconv"; - "strings"; "unicode"; "utf8"; ) diff --git a/src/pkg/ebnf/parser.go b/src/pkg/ebnf/parser.go index 84afd382a..a3fbe6f60 100644 --- a/src/pkg/ebnf/parser.go +++ b/src/pkg/ebnf/parser.go @@ -6,14 +6,10 @@ package ebnf import ( "container/vector"; - "fmt"; "go/scanner"; "go/token"; "os"; "strconv"; - "strings"; - "unicode"; - "utf8"; ) diff --git a/src/pkg/exvar/exvar.go b/src/pkg/exvar/exvar.go index abeeea725..0765a80ee 100644 --- a/src/pkg/exvar/exvar.go +++ b/src/pkg/exvar/exvar.go @@ -11,7 +11,6 @@ import ( "bytes"; "fmt"; "http"; - "io"; "log"; "strconv"; "sync"; diff --git a/src/pkg/exvar/exvar_test.go b/src/pkg/exvar/exvar_test.go index 34b87acfd..eddbbf9e2 100644 --- a/src/pkg/exvar/exvar_test.go +++ b/src/pkg/exvar/exvar_test.go @@ -5,7 +5,6 @@ package exvar import ( - "fmt"; "json"; "testing"; ) diff --git a/src/pkg/flag/flag_test.go b/src/pkg/flag/flag_test.go index 259d507ed..7b796cb14 100644 --- a/src/pkg/flag/flag_test.go +++ b/src/pkg/flag/flag_test.go @@ -6,7 +6,6 @@ package flag_test import ( . "flag"; - "fmt"; "testing"; ) diff --git a/src/pkg/fmt/fmt_test.go b/src/pkg/fmt/fmt_test.go index b294ec4f4..65e76b964 100644 --- a/src/pkg/fmt/fmt_test.go +++ b/src/pkg/fmt/fmt_test.go @@ -10,7 +10,6 @@ import ( "math"; "strings"; "testing"; - "unsafe"; ) func TestFmtInterface(t *testing.T) { diff --git a/src/pkg/go/ast/scope.go b/src/pkg/go/ast/scope.go index f8baa7189..9a62686e3 100644 --- a/src/pkg/go/ast/scope.go +++ b/src/pkg/go/ast/scope.go @@ -4,9 +4,6 @@ package ast -import "go/token"; - - type Scope struct { Outer *Scope; Names map[string]*Ident diff --git a/src/pkg/go/doc/comment.go b/src/pkg/go/doc/comment.go index ae6ab53c3..90212780d 100644 --- a/src/pkg/go/doc/comment.go +++ b/src/pkg/go/doc/comment.go @@ -7,7 +7,6 @@ package doc import ( - "fmt"; "go/ast"; "io"; "once"; diff --git a/src/pkg/go/doc/doc.go b/src/pkg/go/doc/doc.go index 5f9429bb1..9357830b5 100644 --- a/src/pkg/go/doc/doc.go +++ b/src/pkg/go/doc/doc.go @@ -6,13 +6,10 @@ package doc import ( "container/vector"; - "fmt"; "go/ast"; "go/token"; - "io"; "regexp"; "sort"; - "strings"; ) diff --git a/src/pkg/go/parser/interface.go b/src/pkg/go/parser/interface.go index 3ec75637b..f0a323b7a 100644 --- a/src/pkg/go/parser/interface.go +++ b/src/pkg/go/parser/interface.go @@ -8,11 +8,9 @@ package parser import ( "bytes"; - "container/vector"; "fmt"; "go/ast"; "go/scanner"; - "go/token"; "io"; "os"; pathutil "path"; diff --git a/src/pkg/go/parser/parser.go b/src/pkg/go/parser/parser.go index e8a981e8d..d3be849b5 100644 --- a/src/pkg/go/parser/parser.go +++ b/src/pkg/go/parser/parser.go @@ -10,15 +10,11 @@ package parser import ( - "bytes"; "container/vector"; "fmt"; "go/ast"; "go/scanner"; "go/token"; - "io"; - "os"; - "strings"; ) diff --git a/src/pkg/go/parser/parser_test.go b/src/pkg/go/parser/parser_test.go index 03a92d166..bb07f2928 100644 --- a/src/pkg/go/parser/parser_test.go +++ b/src/pkg/go/parser/parser_test.go @@ -5,7 +5,6 @@ package parser import ( - "go/ast"; "os"; "testing"; ) diff --git a/src/pkg/go/printer/printer_test.go b/src/pkg/go/printer/printer_test.go index f9019fdac..b71c79124 100644 --- a/src/pkg/go/printer/printer_test.go +++ b/src/pkg/go/printer/printer_test.go @@ -10,7 +10,6 @@ import ( "io"; "go/ast"; "go/parser"; - "os"; "path"; "testing"; ) diff --git a/src/pkg/gob/decoder.go b/src/pkg/gob/decoder.go index 52a501531..bc3564dbc 100644 --- a/src/pkg/gob/decoder.go +++ b/src/pkg/gob/decoder.go @@ -8,7 +8,6 @@ import ( "bytes"; "io"; "os"; - "reflect"; "sync"; ) diff --git a/src/pkg/gob/encode.go b/src/pkg/gob/encode.go index 45247d5ec..be0fc9b59 100644 --- a/src/pkg/gob/encode.go +++ b/src/pkg/gob/encode.go @@ -10,7 +10,6 @@ import ( "math"; "os"; "reflect"; - "sync"; "unsafe"; ) diff --git a/src/pkg/gob/encoder_test.go b/src/pkg/gob/encoder_test.go index 4cad834d0..178d30f71 100644 --- a/src/pkg/gob/encoder_test.go +++ b/src/pkg/gob/encoder_test.go @@ -11,7 +11,6 @@ import ( "reflect"; "strings"; "testing"; - "unsafe"; ) type ET2 struct { diff --git a/src/pkg/gob/type.go b/src/pkg/gob/type.go index 21da8771d..79dbd7e48 100644 --- a/src/pkg/gob/type.go +++ b/src/pkg/gob/type.go @@ -8,9 +8,7 @@ import ( "fmt"; "os"; "reflect"; - "strings"; "sync"; - "unicode"; ) type kind reflect.Type diff --git a/src/pkg/gob/type_test.go b/src/pkg/gob/type_test.go index ed33487ca..72149a60b 100644 --- a/src/pkg/gob/type_test.go +++ b/src/pkg/gob/type_test.go @@ -5,7 +5,6 @@ package gob import ( - "os"; "reflect"; "testing"; ) diff --git a/src/pkg/http/client.go b/src/pkg/http/client.go index 284106c1a..71f9aa710 100644 --- a/src/pkg/http/client.go +++ b/src/pkg/http/client.go @@ -10,7 +10,6 @@ import ( "bufio"; "fmt"; "io"; - "log"; "net"; "os"; "strconv"; diff --git a/src/pkg/http/client_test.go b/src/pkg/http/client_test.go index 32f2c17b2..9e353dc26 100644 --- a/src/pkg/http/client_test.go +++ b/src/pkg/http/client_test.go @@ -7,7 +7,6 @@ package http import ( - "fmt"; "io"; "strings"; "testing"; diff --git a/src/pkg/http/request_test.go b/src/pkg/http/request_test.go index 4c3cbf8a5..c5762ab29 100644 --- a/src/pkg/http/request_test.go +++ b/src/pkg/http/request_test.go @@ -4,11 +4,7 @@ package http -import ( - "fmt"; - "os"; - "testing"; -) +import "testing" type stringMultimap map[string] []string diff --git a/src/pkg/io/io.go b/src/pkg/io/io.go index be6614b64..070a428f6 100644 --- a/src/pkg/io/io.go +++ b/src/pkg/io/io.go @@ -10,7 +10,6 @@ package io import ( - "bytes"; "os"; "strings"; ) diff --git a/src/pkg/json/parse.go b/src/pkg/json/parse.go index 9ebf1a391..1607013b2 100644 --- a/src/pkg/json/parse.go +++ b/src/pkg/json/parse.go @@ -12,10 +12,7 @@ package json import ( "bytes"; - "fmt"; - "math"; "strconv"; - "strings"; "utf8"; ) diff --git a/src/pkg/net/dialgoogle_test.go b/src/pkg/net/dialgoogle_test.go index cb5389aad..810277713 100644 --- a/src/pkg/net/dialgoogle_test.go +++ b/src/pkg/net/dialgoogle_test.go @@ -7,7 +7,6 @@ package net import ( "flag"; "io"; - "os"; "strings"; "syscall"; "testing"; diff --git a/src/pkg/net/dnsclient.go b/src/pkg/net/dnsclient.go index 4eade1046..a97f75cd5 100644 --- a/src/pkg/net/dnsclient.go +++ b/src/pkg/net/dnsclient.go @@ -16,7 +16,6 @@ package net import ( - "io"; "once"; "os"; "strings"; diff --git a/src/pkg/net/dnsconfig.go b/src/pkg/net/dnsconfig.go index 063c8e9b1..e2d36f97e 100644 --- a/src/pkg/net/dnsconfig.go +++ b/src/pkg/net/dnsconfig.go @@ -6,11 +6,7 @@ package net -import ( - "io"; - "os"; - "strconv"; -) +import "os" type _DNS_Config struct { servers []string; // servers to use diff --git a/src/pkg/net/net_test.go b/src/pkg/net/net_test.go index 15ab2d547..4efb8bf8e 100644 --- a/src/pkg/net/net_test.go +++ b/src/pkg/net/net_test.go @@ -5,7 +5,6 @@ package net import ( - "os"; "regexp"; "testing"; ) diff --git a/src/pkg/net/port.go b/src/pkg/net/port.go index c5789adc9..b806a07f6 100644 --- a/src/pkg/net/port.go +++ b/src/pkg/net/port.go @@ -7,7 +7,6 @@ package net import ( - "io"; "once"; "os"; ) diff --git a/src/pkg/net/server_test.go b/src/pkg/net/server_test.go index 76fc045e5..d961ae068 100644 --- a/src/pkg/net/server_test.go +++ b/src/pkg/net/server_test.go @@ -6,7 +6,6 @@ package net import ( "io"; - "os"; "strings"; "syscall"; "testing"; diff --git a/src/pkg/net/timeout_test.go b/src/pkg/net/timeout_test.go index bc49dadf4..d2edbfaae 100644 --- a/src/pkg/net/timeout_test.go +++ b/src/pkg/net/timeout_test.go @@ -5,7 +5,6 @@ package net import ( - "os"; "testing"; "time"; ) diff --git a/src/pkg/os/proc.go b/src/pkg/os/proc.go index 39d5515ba..3a6f5a16f 100644 --- a/src/pkg/os/proc.go +++ b/src/pkg/os/proc.go @@ -6,10 +6,7 @@ package os -import ( - "syscall"; - "unsafe"; -) +import "syscall" var Args []string; // provided by runtime var Envs []string; // provided by runtime diff --git a/src/pkg/reflect/type.go b/src/pkg/reflect/type.go index 27c28394c..246628752 100644 --- a/src/pkg/reflect/type.go +++ b/src/pkg/reflect/type.go @@ -7,7 +7,6 @@ package reflect import ( "runtime"; "strconv"; - "strings"; "unsafe"; ) diff --git a/src/pkg/rpc/client.go b/src/pkg/rpc/client.go index 4c6dd89ed..216ea5d5c 100644 --- a/src/pkg/rpc/client.go +++ b/src/pkg/rpc/client.go @@ -12,7 +12,6 @@ import ( "log"; "net"; "os"; - "strconv"; "sync"; ) diff --git a/src/pkg/rpc/debug.go b/src/pkg/rpc/debug.go index 990bd1f9c..0bf39a227 100644 --- a/src/pkg/rpc/debug.go +++ b/src/pkg/rpc/debug.go @@ -11,10 +11,7 @@ package rpc import ( "fmt"; - "gob"; "http"; - "io"; - "log"; "os"; "sort"; "template"; diff --git a/src/pkg/rpc/server_test.go b/src/pkg/rpc/server_test.go index ff5de90c8..af58b538a 100644 --- a/src/pkg/rpc/server_test.go +++ b/src/pkg/rpc/server_test.go @@ -5,9 +5,7 @@ package rpc import ( - "gob"; "http"; - "io"; "log"; "net"; "once"; diff --git a/src/pkg/strconv/atof_test.go b/src/pkg/strconv/atof_test.go index e78244ea0..a2894fc75 100644 --- a/src/pkg/strconv/atof_test.go +++ b/src/pkg/strconv/atof_test.go @@ -5,7 +5,6 @@ package strconv_test import ( - "fmt"; "os"; "reflect"; . "strconv"; diff --git a/src/pkg/strconv/atoi_test.go b/src/pkg/strconv/atoi_test.go index ab46e50f4..2632e572a 100644 --- a/src/pkg/strconv/atoi_test.go +++ b/src/pkg/strconv/atoi_test.go @@ -5,7 +5,6 @@ package strconv_test import ( - "fmt"; "os"; "reflect"; . "strconv"; diff --git a/src/pkg/strconv/decimal_test.go b/src/pkg/strconv/decimal_test.go index 35fc795ae..5254cf9a8 100644 --- a/src/pkg/strconv/decimal_test.go +++ b/src/pkg/strconv/decimal_test.go @@ -5,7 +5,6 @@ package strconv_test import ( - "fmt"; . "strconv"; "testing"; ) diff --git a/src/pkg/strconv/fp_test.go b/src/pkg/strconv/fp_test.go index c38762dfb..89092a634 100644 --- a/src/pkg/strconv/fp_test.go +++ b/src/pkg/strconv/fp_test.go @@ -6,7 +6,6 @@ package strconv_test import ( "bufio"; "fmt"; - "io"; "os"; "strconv"; "strings"; diff --git a/src/pkg/strconv/itoa_test.go b/src/pkg/strconv/itoa_test.go index 554c10b8b..56f5fb97c 100644 --- a/src/pkg/strconv/itoa_test.go +++ b/src/pkg/strconv/itoa_test.go @@ -5,8 +5,6 @@ package strconv_test import ( - "fmt"; - "os"; . "strconv"; "testing"; ) diff --git a/src/pkg/syscall/syscall.go b/src/pkg/syscall/syscall.go index 59f35b2bf..c19135255 100644 --- a/src/pkg/syscall/syscall.go +++ b/src/pkg/syscall/syscall.go @@ -11,8 +11,6 @@ // the manuals for the appropriate operating system. package syscall -import "unsafe" - func Syscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2, err uintptr) diff --git a/src/pkg/template/format.go b/src/pkg/template/format.go index 130a26427..bbdfcb4bb 100644 --- a/src/pkg/template/format.go +++ b/src/pkg/template/format.go @@ -10,7 +10,6 @@ import ( "bytes"; "fmt"; "io"; - "reflect"; "strings"; ) diff --git a/src/pkg/template/template_test.go b/src/pkg/template/template_test.go index d3ce37863..11996f609 100644 --- a/src/pkg/template/template_test.go +++ b/src/pkg/template/template_test.go @@ -9,8 +9,6 @@ import ( "container/vector"; "fmt"; "io"; - "os"; - "reflect"; "testing"; ) diff --git a/src/pkg/time/sleep.go b/src/pkg/time/sleep.go index 6f9ab12cb..ee57edd45 100644 --- a/src/pkg/time/sleep.go +++ b/src/pkg/time/sleep.go @@ -7,7 +7,6 @@ package time import ( "os"; "syscall"; - "unsafe"; ) // Sleep pauses the current goroutine for ns nanoseconds. diff --git a/src/pkg/time/tick.go b/src/pkg/time/tick.go index 47ee84fc7..e716ba57a 100644 --- a/src/pkg/time/tick.go +++ b/src/pkg/time/tick.go @@ -4,11 +4,6 @@ package time -import ( - "syscall"; - "unsafe"; -) - // TODO(rsc): This implementation of Tick is a // simple placeholder. Eventually, there will need to be // a single central time server no matter how many tickers diff --git a/src/pkg/utf8/utf8_test.go b/src/pkg/utf8/utf8_test.go index 9c689ca2d..3f06a74a2 100644 --- a/src/pkg/utf8/utf8_test.go +++ b/src/pkg/utf8/utf8_test.go @@ -6,7 +6,6 @@ package utf8_test import ( "bytes"; - "fmt"; "strings"; "testing"; . "utf8"; diff --git a/test/bench/binary-tree-freelist.go b/test/bench/binary-tree-freelist.go index 7babb15fc..0d58d9add 100644 --- a/test/bench/binary-tree-freelist.go +++ b/test/bench/binary-tree-freelist.go @@ -39,7 +39,6 @@ package main import ( "flag"; "fmt"; - "os"; ) var n = flag.Int("n", 15, "depth") diff --git a/test/bench/binary-tree.go b/test/bench/binary-tree.go index 4e25a357b..827fe463e 100644 --- a/test/bench/binary-tree.go +++ b/test/bench/binary-tree.go @@ -39,7 +39,6 @@ package main import ( "flag"; "fmt"; - "os"; ) var n = flag.Int("n", 15, "depth") diff --git a/test/bigalg.go b/test/bigalg.go index 89ece01b9..31ce222d6 100644 --- a/test/bigalg.go +++ b/test/bigalg.go @@ -6,11 +6,6 @@ package main -import ( - "fmt"; - "os"; -) - type T struct { a float64; b int64; diff --git a/test/fixedbugs/bug106.dir/bug1.go b/test/fixedbugs/bug106.dir/bug1.go index 87f4fbb9d..0f1d20e47 100644 --- a/test/fixedbugs/bug106.dir/bug1.go +++ b/test/fixedbugs/bug106.dir/bug1.go @@ -4,5 +4,5 @@ package bug1 -import "./bug0" +import _ "./bug0" diff --git a/test/fixedbugs/bug107.go b/test/fixedbugs/bug107.go index 87cdca7fc..d0b062a65 100644 --- a/test/fixedbugs/bug107.go +++ b/test/fixedbugs/bug107.go @@ -6,6 +6,7 @@ package main import os "os" +type _ os.Error func f() (os int) { // In the next line "os" should refer to the result variable, not // to the package. diff --git a/test/fixedbugs/bug129.go b/test/fixedbugs/bug129.go index f9f6dd031..d1e2d8b56 100644 --- a/test/fixedbugs/bug129.go +++ b/test/fixedbugs/bug129.go @@ -6,7 +6,9 @@ package foo import "fmt" + func f() { + fmt.Println(); fmt := 1; _ = fmt; } diff --git a/test/fixedbugs/bug133.dir/bug2.go b/test/fixedbugs/bug133.dir/bug2.go index cfbb558bf..e53100112 100644 --- a/test/fixedbugs/bug133.dir/bug2.go +++ b/test/fixedbugs/bug133.dir/bug2.go @@ -4,7 +4,7 @@ package bug2 -import "./bug1" +import _ "./bug1" import "./bug0" type T2 struct { t bug0.T } diff --git a/test/fixedbugs/bug163.go b/test/fixedbugs/bug163.go index ac47267fa..919298e6f 100644 --- a/test/fixedbugs/bug163.go +++ b/test/fixedbugs/bug163.go @@ -6,8 +6,6 @@ package main -import "fmt" - func main() { x⊛y := 1; // ERROR "identifier" } diff --git a/test/fixedbugs/bug177.go b/test/fixedbugs/bug177.go index b2c68a0fe..84ff59d2f 100644 --- a/test/fixedbugs/bug177.go +++ b/test/fixedbugs/bug177.go @@ -5,7 +5,6 @@ // license that can be found in the LICENSE file. package main -import "fmt" import "reflect" type S1 struct { i int } type S2 struct { S1 } diff --git a/test/fixedbugs/bug188.go b/test/fixedbugs/bug188.go index 3851cb672..e1cbce05d 100644 --- a/test/fixedbugs/bug188.go +++ b/test/fixedbugs/bug188.go @@ -9,6 +9,7 @@ package main import "sort" func main() { + sort.Sort(nil); var x int; sort(x); // ERROR "package" } diff --git a/test/fixedbugs/bug191.dir/a.go b/test/fixedbugs/bug191.dir/a.go index 67340359d..b87ad6f4f 100644 --- a/test/fixedbugs/bug191.dir/a.go +++ b/test/fixedbugs/bug191.dir/a.go @@ -7,3 +7,6 @@ package a func init() { println("a"); } + +type T int; + diff --git a/test/fixedbugs/bug191.dir/b.go b/test/fixedbugs/bug191.dir/b.go index a2d559630..3e780ac0d 100644 --- a/test/fixedbugs/bug191.dir/b.go +++ b/test/fixedbugs/bug191.dir/b.go @@ -7,3 +7,5 @@ package b func init() { println("b"); } + +type V int; diff --git a/test/fixedbugs/bug191.go b/test/fixedbugs/bug191.go index fe03f646d..44fcccfc0 100644 --- a/test/fixedbugs/bug191.go +++ b/test/fixedbugs/bug191.go @@ -9,5 +9,8 @@ package main import . "./a" import . "./b" +var _ T +var _ V + func main() { } diff --git a/test/initsyscall.go b/test/initsyscall.go index 7765de84d..139bb0acb 100644 --- a/test/initsyscall.go +++ b/test/initsyscall.go @@ -12,7 +12,6 @@ package main -import "log" import "time" func f() { |