Tuesday, May 29, 2012

“Go” Language Tutorial-3(package)

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

2 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete