Skip to content

x/tools/imports: packages with non-standard names deleted unless imported with explicit name #9882

@taruti

Description

@taruti

Go imports deletes the termbox import in the following code:

package main

import "fmt"
import "github.com/nsf/termbox-go"

func main() {
    fmt.Println(termbox.Size())
}

A named import however works:

import termbox "github.com/nsf/termbox-go"

works fine.

If such package naming should be banned (could be a good idea) go vet could warn about them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions