Saturday, 15 August 2015

Basic Go: Imports and Exports

Import
This code groups the imports into a parenthesized, "factored" import statement.
You can also write multiple import statements, like:
import "fmt"
import "math"
But it is good style to use the factored import statement.



Export
After importing a package, you can refer to the names it exports.
In Go, a name is exported if it begins with a capital letter.
Foo is an exported name, as is FOO. The name foo is not exported.
Run the code. Then rename math.pi to math.Pi and try it again.



Do comment, if it worked/Not worked for you.

No comments:

Post a Comment