“Go” Language Tutorial-4(Imports)

Posted: June 26, 2012 in Go, Language
Tags: , , , , ,

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.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s