Wednesday, December 12, 2012

GOOGLE GO PROGRAMMING LANGUAGE (GOLANG) INTRODUCTION

GOOGLE GO PROGRAMMING LANGUAGE (GOLANG) INTRODUCTION



REVISED: Friday, March 1, 2013




Google Golang tutorial.

I. GOOGLE GO PROGRAMMING LANGUAGE INTRODUCTION

Go is both a general-purpose and a systems programming language designed by Robert Griesemer, Rob Pike, and Ken Thompson; and released on November 10, 2009. Go is a language which compiles quickly and is intended to be a replacement for C and C++ in systems programming. Go is strongly typed and garbage-collected and has explicit support for clarity of code and concurrent programming. Source code is Unicode text encoded in UTF8. Go's official web site is golang.org, and  Go's official blog is Go Programming Language Blog.

II. GO COMMENTS

There are two forms of comments. The character sequence // starts a single line comment which stops at the end of the line. Multiple line comments start with the character sequence /* and continue through the character sequence */.

III. GO PROGRAM SYNTAX

Every Go program is made up of one or more packages. Packages in Go serve as the classes for routines. Each package is one or more source files compiled and imported as a unit. Programs start running in package main.

package main // Every program must have a package main.

import "fmt" 
func main() { /* Opening curly brace { must be on a func declaration line, as shown, and not on a new line by itself. */
// Every program must have a func main.
// func tells the Go compiler this is a function.

/* Go program statements are inserted here between the { }. */

   fmt.Println("Hello World!"); /* Go statements end with a ; semicolon.  */
/* Dot operator . is used  to tell the Go compiler the Println() function was imported in the fmt package. */
}

Go output:

Hello World!

Enjoy Google Golang.


Elcric Otto Circle




-->



-->



-->





 







How to Link to My Home Page

The link will appear on your website as:

"Link to: ELCRIC OTTO CIRCLE's Home Page"




No comments:

Post a Comment