Source file src/internal/types/testdata/fixedbugs/issue43190.go

     1  // Copyright 2020 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // The errors below are produced by the parser, but we check
     6  // them here for consistency with the types2 tests.
     7  
     8  package p
     9  
    10  import ; // ERROR "missing import path"
    11  import "" // ERROR "invalid import path (empty string)"
    12  import
    13  var /* ERROR "missing import path" */ _ int
    14  import .; // ERROR "missing import path"
    15  import 'x' // ERROR "import path must be a string"
    16  var _ int
    17  import /* ERROR "imports must appear before other declarations" */ _ "math"
    18  
    19  // Don't repeat previous error for each immediately following import ...
    20  import ()
    21  import (.) // ERROR "missing import path"
    22  import (
    23  	"fmt"
    24  	.
    25  ) // ERROR "missing import path"
    26  
    27  // ... but remind with error again if we start a new import section after
    28  // other declarations
    29  var _ = fmt.Println
    30  import /* ERROR "imports must appear before other declarations" */ _ "math"
    31  import _ "math"
    32  

View as plain text