Commit 20011bc8 authored by Russ Cox's avatar Russ Cox

unused imports

R=r
OCL=34731
CL=34731
parent 1401151a
......@@ -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');
......
......@@ -40,13 +40,11 @@ import (
"http";
"io";
"log";
"net";
"os";
pathutil "path";
"sort";
"strings";
"sync";
"syscall";
"template";
"time";
)
......
......@@ -11,10 +11,8 @@ import (
"go/parser";
"go/printer";
"go/scanner";
"io";
"os";
pathutil "path";
"sort";
"strings";
)
......
......@@ -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
......
......@@ -6,7 +6,6 @@ package tar
import (
"bytes";
"fmt";
"io";
"os";
"reflect";
......
......@@ -8,9 +8,6 @@ import (
"bytes";
"fmt";
"io";
"os";
"reflect";
"strings";
"testing";
)
......
......@@ -10,11 +10,7 @@ package flate
import (
"bytes";
"bufio";
"io";
"os";
"reflect";
"strconv";
"testing";
)
......
......@@ -6,7 +6,6 @@ package gzip
import (
"bytes";
"fmt";
"io";
"os";
"testing";
......
......@@ -5,7 +5,6 @@
package aes
import (
"fmt";
"testing";
)
......
......@@ -14,7 +14,6 @@ import (
"bytes";
"crypto/aes";
"io";
"os";
"testing";
)
......
......@@ -14,7 +14,6 @@ import (
"bytes";
"crypto/aes";
"io";
"os";
"testing";
)
......
......@@ -7,10 +7,7 @@
package block
import (
"io";
"os";
)
import "os"
const (
// minimal irreducible polynomial of degree b
......
......@@ -14,7 +14,6 @@ import (
"bytes";
"crypto/aes";
"io";
"os";
"testing";
)
......
......@@ -14,7 +14,6 @@ import (
"bytes";
"crypto/aes";
"io";
"os";
"testing";
)
......
......@@ -14,7 +14,6 @@ import (
"bytes";
"crypto/aes";
"io";
"os";
"testing";
)
......
......@@ -203,15 +203,12 @@ package datafmt
import (
"bytes";
"container/vector";
"fmt";
"go/token";
"io";
"os";
"reflect";
"runtime";
"strconv";
"strings";
)
......
......@@ -6,7 +6,6 @@ package datafmt
import (
"fmt";
"os";
"strings";
"testing";
)
......
......@@ -6,7 +6,6 @@ package datafmt
import (
"container/vector";
"fmt";
"go/scanner";
"go/token";
"os";
......
......@@ -10,10 +10,7 @@
package dwarf
import (
"os";
"strconv";
)
import "os"
// a single entry's description: a sequence of attributes
type abbrev struct {
......
......@@ -9,7 +9,6 @@ package dwarf
import (
"debug/binary";
"fmt";
"os";
)
......
......@@ -8,10 +8,7 @@
package gosym
import (
"debug/binary";
"io";
)
import "debug/binary"
type LineTable struct {
Data []byte;
......
......@@ -6,8 +6,6 @@ package gosym
import (
"debug/elf";
"exec";
"io";
"os";
"testing";
"syscall";
......
......@@ -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
......
......@@ -24,12 +24,9 @@ package ebnf
import (
"container/vector";
"fmt";
"go/scanner";
"go/token";
"os";
"strconv";
"strings";
"unicode";
"utf8";
)
......
......@@ -6,14 +6,10 @@ package ebnf
import (
"container/vector";
"fmt";
"go/scanner";
"go/token";
"os";
"strconv";
"strings";
"unicode";
"utf8";
)
......
......@@ -11,7 +11,6 @@ import (
"bytes";
"fmt";
"http";
"io";
"log";
"strconv";
"sync";
......
......@@ -5,7 +5,6 @@
package exvar
import (
"fmt";
"json";
"testing";
)
......
......@@ -6,7 +6,6 @@ package flag_test
import (
. "flag";
"fmt";
"testing";
)
......
......@@ -10,7 +10,6 @@ import (
"math";
"strings";
"testing";
"unsafe";
)
func TestFmtInterface(t *testing.T) {
......
......@@ -4,9 +4,6 @@
package ast
import "go/token";
type Scope struct {
Outer *Scope;
Names map[string]*Ident
......
......@@ -7,7 +7,6 @@
package doc
import (
"fmt";
"go/ast";
"io";
"once";
......
......@@ -6,13 +6,10 @@ package doc
import (
"container/vector";
"fmt";
"go/ast";
"go/token";
"io";
"regexp";
"sort";
"strings";
)
......
......@@ -8,11 +8,9 @@ package parser
import (
"bytes";
"container/vector";
"fmt";
"go/ast";
"go/scanner";
"go/token";
"io";
"os";
pathutil "path";
......
......@@ -10,15 +10,11 @@
package parser
import (
"bytes";
"container/vector";
"fmt";
"go/ast";
"go/scanner";
"go/token";
"io";
"os";
"strings";
)
......
......@@ -5,7 +5,6 @@
package parser
import (
"go/ast";
"os";
"testing";
)
......
......@@ -10,7 +10,6 @@ import (
"io";
"go/ast";
"go/parser";
"os";
"path";
"testing";
)
......
......@@ -8,7 +8,6 @@ import (
"bytes";
"io";
"os";
"reflect";
"sync";
)
......
......@@ -10,7 +10,6 @@ import (
"math";
"os";
"reflect";
"sync";
"unsafe";
)
......
......@@ -11,7 +11,6 @@ import (
"reflect";
"strings";
"testing";
"unsafe";
)
type ET2 struct {
......
......@@ -8,9 +8,7 @@ import (
"fmt";
"os";
"reflect";
"strings";
"sync";
"unicode";
)
type kind reflect.Type
......
......@@ -5,7 +5,6 @@
package gob
import (
"os";
"reflect";
"testing";
)
......
......@@ -10,7 +10,6 @@ import (
"bufio";
"fmt";
"io";
"log";
"net";
"os";
"strconv";
......
......@@ -7,7 +7,6 @@
package http
import (
"fmt";
"io";
"strings";
"testing";
......
......@@ -4,11 +4,7 @@
package http
import (
"fmt";
"os";
"testing";
)
import "testing"
type stringMultimap map[string] []string
......
......@@ -10,7 +10,6 @@
package io
import (
"bytes";
"os";
"strings";
)
......
......@@ -12,10 +12,7 @@ package json
import (
"bytes";
"fmt";
"math";
"strconv";
"strings";
"utf8";
)
......
......@@ -7,7 +7,6 @@ package net
import (
"flag";
"io";
"os";
"strings";
"syscall";
"testing";
......
......@@ -16,7 +16,6 @@
package net
import (
"io";
"once";
"os";
"strings";
......
......@@ -6,11 +6,7 @@
package net
import (
"io";
"os";
"strconv";
)
import "os"
type _DNS_Config struct {
servers []string; // servers to use
......
......@@ -5,7 +5,6 @@
package net
import (
"os";
"regexp";
"testing";
)
......
......@@ -7,7 +7,6 @@
package net
import (
"io";
"once";
"os";
)
......
......@@ -6,7 +6,6 @@ package net
import (
"io";
"os";
"strings";
"syscall";
"testing";
......
......@@ -5,7 +5,6 @@
package net
import (
"os";
"testing";
"time";
)
......
......@@ -6,10 +6,7 @@
package os
import (
"syscall";
"unsafe";
)
import "syscall"
var Args []string; // provided by runtime
var Envs []string; // provided by runtime
......
......@@ -7,7 +7,6 @@ package reflect
import (
"runtime";
"strconv";
"strings";
"unsafe";
)
......
......@@ -12,7 +12,6 @@ import (
"log";
"net";
"os";
"strconv";
"sync";
)
......
......@@ -11,10 +11,7 @@ package rpc
import (
"fmt";
"gob";
"http";
"io";
"log";
"os";
"sort";
"template";
......
......@@ -5,9 +5,7 @@
package rpc
import (
"gob";
"http";
"io";
"log";
"net";
"once";
......
......@@ -5,7 +5,6 @@
package strconv_test
import (
"fmt";
"os";
"reflect";
. "strconv";
......
......@@ -5,7 +5,6 @@
package strconv_test
import (
"fmt";
"os";
"reflect";
. "strconv";
......
......@@ -5,7 +5,6 @@
package strconv_test
import (
"fmt";
. "strconv";
"testing";
)
......
......@@ -6,7 +6,6 @@ package strconv_test
import (
"bufio";
"fmt";
"io";
"os";
"strconv";
"strings";
......
......@@ -5,8 +5,6 @@
package strconv_test
import (
"fmt";
"os";
. "strconv";
"testing";
)
......
......@@ -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)
......
......@@ -10,7 +10,6 @@ import (
"bytes";
"fmt";
"io";
"reflect";
"strings";
)
......
......@@ -9,8 +9,6 @@ import (
"container/vector";
"fmt";
"io";
"os";
"reflect";
"testing";
)
......
......@@ -7,7 +7,6 @@ package time
import (
"os";
"syscall";
"unsafe";
)
// Sleep pauses the current goroutine for ns nanoseconds.
......
......@@ -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
......
......@@ -6,7 +6,6 @@ package utf8_test
import (
"bytes";
"fmt";
"strings";
"testing";
. "utf8";
......
......@@ -39,7 +39,6 @@ package main
import (
"flag";
"fmt";
"os";
)
var n = flag.Int("n", 15, "depth")
......
......@@ -39,7 +39,6 @@ package main
import (
"flag";
"fmt";
"os";
)
var n = flag.Int("n", 15, "depth")
......
......@@ -6,11 +6,6 @@
package main
import (
"fmt";
"os";
)
type T struct {
a float64;
b int64;
......
......@@ -4,5 +4,5 @@
package bug1
import "./bug0"
import _ "./bug0"
......@@ -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.
......
......@@ -6,7 +6,9 @@
package foo
import "fmt"
func f() {
fmt.Println();
fmt := 1;
_ = fmt;
}
......@@ -4,7 +4,7 @@
package bug2
import "./bug1"
import _ "./bug1"
import "./bug0"
type T2 struct { t bug0.T }
......
......@@ -6,8 +6,6 @@
package main
import "fmt"
func main() {
xy := 1; // ERROR "identifier"
}
......@@ -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 }
......
......@@ -9,6 +9,7 @@ package main
import "sort"
func main() {
sort.Sort(nil);
var x int;
sort(x); // ERROR "package"
}
......@@ -7,3 +7,6 @@ package a
func init() {
println("a");
}
type T int;
......@@ -7,3 +7,5 @@ package b
func init() {
println("b");
}
type V int;
......@@ -9,5 +9,8 @@ package main
import . "./a"
import . "./b"
var _ T
var _ V
func main() {
}
......@@ -12,7 +12,6 @@
package main
import "log"
import "time"
func f() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment