Offenbar zu ermöglichen, die Unterstreichungs Gewicht das gleiche wie der Punkt Präfix am Anfang von Dateien und einfach ignoriert durch den go build
Befehl. Dies ist jedoch keine Entscheidung des go
-Tools, sondern des go/build
-Pakets in der Standardbibliothek. Sie können die zuständige Zeile here sehen.
Meine Vermutung ist, dass temporäre Dateien mit Unterstrichen vorangestellt sind, so dass sie von der Build-Tool-Kette ignoriert werden.
Edit: This comment dokumentiert das Verhalten. Ich zitiere:
// Import returns details about the Go package named by the import path,
// interpreting local import paths relative to the srcDir directory.
// If the path is a local import path naming a package that can be imported
// using a standard import path, the returned package will set p.ImportPath
// to that path.
//
// In the directory containing the package, .go, .c, .h, and .s files are
// considered part of the package except for:
//
// - .go files in package documentation
// - files starting with _ or . (likely editor temporary files)
// - files with build constraints not satisfied by the context
//
// If an error occurs, Import returns a non-nil error and a non-nil
// *Package containing partial information.
//
Und Sie können diese in benutzerfreundlicher Form im package docs of package go/build
finden.