Packages Importable in the Go Playground
Q: What packages can be imported when using the Go playground (http://play.golang.org/)?
A: The Go playground allows imports from most packages within the standard library, as stated in the “About” button on the playground.
Exceptions to Importability
The standard library packages that cannot be imported in the playground are:
Playground Implementation
For a detailed explanation of the playground implementation, refer to "Inside the Go Playground" published on the Go Blog.
Exhaustive Playground Test
The following code demonstrates the importability of all standard library packages (excluding non-buildable packages):
package main import ( // ... imports for all standard library packages listed in the "Packages" page ... ) func main() { println("ok") }
This code imports all standard library packages except runtime/cgo, which gives a compilation error due to missing Go type information.
The above is the detailed content of What Standard Library Packages Can Be Imported in the Go Playground?. For more information, please follow other related articles on the PHP Chinese website!