Go Keyword import

From NovaOrdis Knowledge Base
Revision as of 05:55, 22 March 2016 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

External

Internal

Overview

An import declaration states that the current package depends on the functionality of the imported package and wants access to its name space. Thus, the current package gains access to the exported identifiers exposed by the imported package.

...
import [package-name-alias] "package-path"
...

Example

...
import "lib/math"
...

The package-name-alias is optional. If not specified, the package will be referred under the name