I know to import a package, we could use
import (
"golang.org/x/text"
)
I have a question about the golang.org/x
? Is this the namespace for all standard libraries to live? How does this namespace play in the go ecosystem?
Thanks.
I know to import a package, we could use
import (
"golang.org/x/text"
)
I have a question about the golang.org/x
? Is this the namespace for all standard libraries to live? How does this namespace play in the go ecosystem?
Thanks.
From the mailing list thread, it looks like the import path,
golang.org/x
, was introduced for sub-repositories packages in Go 1.4:The x means eXternal to standard libraries.
So
golang.org/x
is the import path for sub-repositories packages.import "net/http"
(Standard Library)import "golang.org/x/text"
(Library in sub-repository)