Tuesday, May 29, 2012

“Go” Language Tutorial-4(Imports)

Imports



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's common to use the factored form to eliminate clutter.

 

Example :

package main

import (
"fmt"
"math"
)

func main() {
fmt.Printf("Now you have %g problems.",
math.Nextafter(2, 3))
}

output:
Now you have 2.0000000000000004 problems.

No comments:

Post a Comment