“Go” Language Tutorial-3(package)

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

PACKAGES

 

Every Go program is made up of packages.

Programs start running in package main.

This program is using the packages with import paths "fmt" and"math".

By convention, the package name is the same as the last element of the import path.

Example:

package main

import (
“fmt”
“math”
)

func main() {
fmt.Println(“Happy”, math.Pi, “Day”)
}

output :

Happy 3.141592653589793 Day
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