3 ms·
> I thought it infers the name from the last part of the URL if it's not prefixed with an alias. The name and the last part of the url are unrelated. They're
by TheDong 6y ago
> I thought it infers the name from the last part of the URL if it's not prefixed with an alias.
The name and the last part of the url are unrelated.
They're only usually the same by convention. For example:
import (
"fmt"
"github.com/dimuska139/go-email-normalizer"
)
func main() {
fmt.Println(emailnormalizer.NewNormalizer().Normalize("x+1@gmail.com"))
}
The reason that I use "go-email-normalizer" as "emailnormalizer" is entirely unrelated to the url it's at or the name of the repo it's in. The only reason you use "emailnormalizer" is because that's the package line in all the files in that package: https://github.com/dimuska139/go-email-normalizer/blob/0432b8b7035/normalizer.go#L1 https://github.com/dimuska139/go-email-normalizer/blob/0432b...
Importing a go package will add an arbitrary identifier to the file scope, and you can't know that identifier without reading the package statement of the package you imported.