Preferably enforce that the namespace matches the include/import statement, if the statement doesn't use an explicit name binding...
import "foo/bar" should make foo.* OR bar.* available, not bazz.*. I'm looking at you, Go.
import "foo/bar" should make foo.* OR bar.* available, not bazz.*. I'm looking at you, Go.
Can you give an example of what you mean?
```go
import (
"net/http"
"os"
"github.com/anacrolix/torrent"
tstor "github.com/anacrolix/torrent/storage"
)
```would import as: http, os, torrent and tstor. That guy is mixed up.
For example you can have github.com/user/go-module as module name, and "module" as package name, so "import github.com/user/go-module" will be imported as "module.*".
There’s a linter that automatically aliases this kind of imports with their actual module name so that it’s non ambiguous when reading the import list.
package main
// imports 'bar', you couldn't possibly know from reading this line
import "github.com/remram44/foo20240527"
func main() {
// ??? where does this function come from ???
bar.SomeFunc()
}I’m so confused by this. Unless you use a dot import, isn’t this just bar.*?
I posted a criticism of Go, I don't know what you mean by "this is how it normally works".