import (
"errors"
- "http"
"io/ioutil"
+ "net/http"
"regexp"
- "template"
+ "text/template"
)
type Page struct {
package main
import (
- "http"
"io/ioutil"
- "template"
+ "net/http"
+ "text/template"
)
type Page struct {
package main
import (
- "http"
"io/ioutil"
+ "net/http"
"regexp"
- "template"
+ "text/template"
)
type Page struct {
package main
import (
- "http"
"io/ioutil"
- "template"
+ "net/http"
+ "text/template"
)
type Page struct {
package main
import (
- "http"
"io/ioutil"
+ "net/http"
"regexp"
- "template"
+ "text/template"
)
type Page struct {
package main
import (
- "http"
"flag"
"fmt"
"io"
"log"
"net"
+ "net/http"
"os"
"strings"
)
package main
import (
- "template"
- "os"
"io/ioutil"
+ "os"
+ "text/template"
)
func main() {
import (
"fmt"
- "http"
+ "net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
import (
"fmt"
- "http"
+ "net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
import (
"fmt"
- "http"
"io/ioutil"
+ "net/http"
)
type Page struct {
import (
"fmt"
- "http"
"io/ioutil"
+ "net/http"
)
type Page struct {
import (
"bytes"
"flag"
+ "go/ast"
"go/parser"
"go/printer"
- "go/ast"
"go/token"
"log"
- "template"
"os"
+ "text/template"
)
var (
"flag"
"fmt"
"io"
+ "math/rand"
"os"
- "rand"
"strings"
"time"
)
import (
"fmt"
- "rand"
+ "math/rand"
)
const (
package main
import (
- "http"
"log"
+ "net/http"
"time"
)
import (
"flag"
- "http"
"log"
- "template"
+ "net/http"
+ "text/template"
)
var addr = flag.String("addr", ":1718", "http service address") // Q=17, R=18
"container/heap"
"flag"
"fmt"
- "rand"
+ "math/rand"
"time"
)
"os"
"regexp"
"strings"
- "template"
+ "text/template"
)
func Usage() {
import (
"bytes"
- "exec"
"io"
"log"
"os"
+ "os/exec"
"strings"
)
import (
"bytes"
+ "encoding/json"
"errors"
"fmt"
- "http"
- "json"
"log"
+ "net/http"
+ "net/url"
"strconv"
- "url"
)
type param map[string]string
package main
import (
+ "encoding/xml"
"errors"
"flag"
"fmt"
"strconv"
"strings"
"time"
- "xml"
)
const (
package main
import (
- "exec"
"flag"
- "http"
"io"
"io/ioutil"
"log"
+ "net/http"
"os"
+ "os/exec"
"runtime"
"strconv"
- "template"
+ "text/template"
)
var (
package main
import (
- "exec"
"fmt"
"go/token"
"io/ioutil"
"os"
+ "os/exec"
)
// run runs the command argv, feeding in stdin on standard input.
"io"
"os"
"strings"
- "template"
+ "text/template"
)
// A Command is an implementation of a go command
import (
"archive/zip"
- "http"
"log"
+ "net/http"
"path"
)
package main
import (
+ "encoding/xml"
"errors"
"fmt"
- "http"
"io"
"log"
+ "net/http"
"os"
"regexp"
"sort"
"strconv"
"strings"
- "template"
- "utf8"
- "xml"
+ "text/template"
+ "unicode/utf8"
)
// Handler for /doc/codewalk/ and below.
"io"
"regexp"
"strconv"
- "template"
+ "text/template"
)
// ----------------------------------------------------------------------------
"go/doc"
"go/printer"
"go/token"
- "http"
"io"
"log"
+ "net/http"
"os"
"path"
"path/filepath"
"runtime"
"sort"
"strings"
- "template"
+ "text/template"
"time"
)
import (
"archive/zip"
"fmt"
- "http"
"io"
+ "net/http"
"os"
"path"
"sort"
import (
"bufio"
"bytes"
+ "encoding/gob"
"errors"
"go/ast"
"go/parser"
"go/scanner"
"go/token"
- "gob"
"index/suffixarray"
"io"
"path/filepath"
"fmt"
"go/ast"
"go/build"
- "http"
- _ "http/pprof" // to serve /debug/pprof/*
"io"
"log"
+ "net/http"
+ _ "net/http/pprof" // to serve /debug/pprof/*
+ "net/url"
"os"
"path"
"path/filepath"
"runtime"
"strings"
"time"
- "url"
)
const defaultAddr = ":6060" // default webserver address
"bytes"
"fmt"
"io"
- "scanner"
+ "text/scanner"
)
type ebnfParser struct {
"strings"
"sync"
"time"
- "utf8"
+ "unicode/utf8"
)
// An RWValue wraps a value and permits mutually exclusive
import (
"bytes"
- "exec"
"flag"
"fmt"
"go/ast"
"go/token"
"io/ioutil"
"os"
+ "os/exec"
"path/filepath"
"sort"
"strings"
import (
"bytes"
- "exec"
"flag"
"fmt"
"go/ast"
"io"
"io/ioutil"
"os"
+ "os/exec"
"path/filepath"
"runtime/pprof"
"strings"
"reflect"
"strings"
"unicode"
- "utf8"
+ "unicode/utf8"
)
func initRewrite() {
import (
"bytes"
+ "encoding/json"
"errors"
- "exec"
"fmt"
- "http"
- "json"
+ "net/http"
"os"
+ "os/exec"
"path/filepath"
"regexp"
"runtime"
import (
"bytes"
"errors"
- "exec"
"flag"
"fmt"
"go/build"
"go/token"
"io/ioutil"
"os"
+ "os/exec"
"path/filepath" // use for file system paths
"regexp"
"runtime"
"go/build"
"path" // use for import paths
"strings"
- "template"
+ "text/template"
)
// domake builds the package in dir.
import (
"bufio"
- "exec"
"fmt"
"go/ast"
"go/build"
"go/token"
"io/ioutil"
"os"
+ "os/exec"
"runtime"
"sort"
"strings"
"time"
"unicode"
- "utf8"
+ "unicode/utf8"
)
// Environment for commands.
"reflect"
"strconv"
"strings"
- "utf8"
+ "unicode/utf8"
)
var verbose = flag.Bool("v", false, "verbose")
import (
"bytes"
- "exec"
"flag"
"fmt"
"io/ioutil"
"os"
+ "os/exec"
"patch"
"path/filepath"
"sort"
import (
"fmt"
- "utf8"
+ "unicode/utf8"
)
-func f(byte) {}
+func f(byte) {}
func g(uint8) {}
func main() {
var x float64
- f(x) // ERROR "byte"
- g(x) // ERROR "uint8"
+ f(x) // ERROR "byte"
+ g(x) // ERROR "uint8"
// Test across imports.
var ff fmt.Formatter
var fs fmt.State
- ff.Format(fs, x) // ERROR "rune"
+ ff.Format(fs, x) // ERROR "rune"
- utf8.RuneStart(x) // ERROR "byte"
+ utf8.RuneStart(x) // ERROR "byte"
var s utf8.String
- s.At(x) // ERROR "int"
+ s.At(x) // ERROR "int"
}
package main
import (
- "big"
"flag"
"fmt"
+ "math/big"
)
var n = flag.Int("n", 27, "number of digits")
"fmt"
"io"
"os"
- "template"
+ "text/template"
)
func main() {
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()
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
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")
"go/ast"
"go/parser"
"go/token"
+ "log"
+ "net/http"
+ _ "net/http/pprof"
"os"
"path"
"runtime"
"strings"
"time"
- "http"
- _ "http/pprof"
- "log"
)
var serve = flag.String("serve", "", "serve http on this address at end")
package main
-import "rand"
+import "math/rand"
const Count = 1e5
package main
-import "rand"
+import "math/rand"
const Count = 1e5
import (
"flag"
- "rand"
+ "math/rand"
"runtime"
"unsafe"
)
import (
"fmt"
"os"
- "utf8"
+ "unicode/utf8"
)
func main() {
package main
-import "utf8"
+import "unicode/utf8"
func main() {
var chars [6]rune