123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- // package comment
- package main
- import (
- "errors"
- "fmt"
- "io"
- "log"
- "math"
- )
- import (
- "fmt"
- "math"
- "log"
- "errors"
- "io"
- )
- // We reset the line numbering to test that
- // the formatting works independent of line directives
- //line :19
- import (
- "errors"
- "fmt"
- "io"
- "log"
- "math"
- "fmt"
- "math"
- "log"
- "errors"
- "io"
- )
- import (
- // a block with comments
- "errors"
- "fmt" // for Printf
- "io" // for Reader
- "log" // for Fatal
- "math"
- )
- import (
- "fmt" // for Printf
- "math"
- "log" // for Fatal
- "errors"
- "io" // for Reader
- )
- import (
- // for Printf
- "fmt"
- "math"
- // for Fatal
- "log"
- "errors"
- // for Reader
- "io"
- )
- import (
- "errors"
- "fmt" // for Printf
- "io" // for Reader
- "log" // for Fatal
- "math"
- "fmt" // for Printf
- "math"
- "log" // for Fatal
- "errors"
- "io" // for Reader
- )
- import (
- "fmt" // for Printf
- "errors"
- "io" // for Reader
- "log" // for Fatal
- "math"
- "errors"
- "fmt" // for Printf
- "io" // for Reader
- "log" // for Fatal
- "math"
- )
- // Test deduping and extended sorting
- import (
- a "A" // aA
- b "A" // bA1
- b "A" // bA2
- "B" // B
- . "B" // .B
- _ "B" // _b
- "C"
- a "D" // aD
- )
- import (
- "dedup_by_group"
- "dedup_by_group"
- )
- import (
- "fmt" // for Printf
- /* comment */ io1 "io"
- /* comment */ io2 "io"
- /* comment */ "log"
- )
- import (
- "fmt"
- /* comment */ io1 "io"
- /* comment */ io2 "io" // hello
- "math" /* right side */
- // end
- )
- import (
- "errors" // for New
- "fmt"
- /* comment */ io1 "io" /* before */ // after
- io2 "io" // another
- // end
- )
- import (
- "errors" // for New
- /* left */ "fmt" /* right */
- "log" // for Fatal
- /* left */ "math" /* right */
- )
- import /* why */ /* comment here? */ (
- /* comment */ "fmt"
- "math"
- )
- // Reset it again
- //line :100
- // Dedup with different import styles
- import (
- "path"
- . "path"
- _ "path"
- pathpkg "path"
- )
- /* comment */
- import (
- "fmt"
- "math" // for Abs
- // This is a new run
- "errors"
- "fmt"
- )
- // End an import declaration in the same line
- // as the last import. See golang.org/issue/33538.
- // Note: Must be the last (or 2nd last) line of the file.
- import (
- "fmt"
- "math"
- )
|