This test verifies the behavior of the 'source.organizeImports' code action.

-- go.mod --
module mod.test/imports

go 1.18

-- add.go --
package imports //@codeaction("imports", "source.organizeImports", result=add)

import (
	"fmt"
)

func _() {
	fmt.Println("")
	bytes.NewBuffer(nil) //@diag("bytes", re"(undeclared|undefined)")
}

-- @add/add.go --
package imports //@codeaction("imports", "source.organizeImports", result=add)

import (
	"bytes"
	"fmt"
)

func _() {
	fmt.Println("")
	bytes.NewBuffer(nil) //@diag("bytes", re"(undeclared|undefined)")
}

-- good.go --
package imports //@codeaction("imports", "source.organizeImports", err=re"found 0 CodeActions")

import "fmt"

func _() {
fmt.Println("")
}

-- issue35458.go --





// package doc
package imports //@codeaction("imports", "source.organizeImports", result=issue35458)






func _() {
	println("Hello, world!")
}








-- @issue35458/issue35458.go --
// package doc
package imports //@codeaction("imports", "source.organizeImports", result=issue35458)






func _() {
	println("Hello, world!")
}








-- multi.go --
package imports //@codeaction("imports", "source.organizeImports", result=multi)

import "fmt"

import "bytes" //@diag("\"bytes\"", re"not used")

func _() {
	fmt.Println("")
}

-- @multi/multi.go --
package imports //@codeaction("imports", "source.organizeImports", result=multi)

import "fmt"

//@diag("\"bytes\"", re"not used")

func _() {
	fmt.Println("")
}

-- needs.go --
package imports //@codeaction("package", "source.organizeImports", result=needs)

func goodbye() {
	fmt.Printf("HI") //@diag("fmt", re"(undeclared|undefined)")
	log.Printf("byeeeee") //@diag("log", re"(undeclared|undefined)")
}

-- @needs/needs.go --
package imports //@codeaction("package", "source.organizeImports", result=needs)

import (
	"fmt"
	"log"
)

func goodbye() {
	fmt.Printf("HI") //@diag("fmt", re"(undeclared|undefined)")
	log.Printf("byeeeee") //@diag("log", re"(undeclared|undefined)")
}

-- remove.go --
package imports //@codeaction("package", "source.organizeImports", result=remove)

import (
	"bytes" //@diag("\"bytes\"", re"not used")
	"fmt"
)

func _() {
	fmt.Println("")
}

-- @remove/remove.go --
package imports //@codeaction("package", "source.organizeImports", result=remove)

import (
	"fmt"
)

func _() {
	fmt.Println("")
}

-- removeall.go --
package imports //@codeaction("package", "source.organizeImports", result=removeall)

import (
	"bytes" //@diag("\"bytes\"", re"not used")
	"fmt" //@diag("\"fmt\"", re"not used")

)

func _() {
}

-- @removeall/removeall.go --
package imports //@codeaction("package", "source.organizeImports", result=removeall)

//@diag("\"fmt\"", re"not used")

func _() {
}

-- twolines.go --
package imports
func main()  {} //@codeaction("main", "source.organizeImports", err=re"found 0")
