Go - Overview
Go originated as an experiment by Google engineers Robert
Griesemer,Rob Pike, and Ken Thompson to design a new programming
language that would resolve common criticisms of other languages
while maintaining their positive characteristics
 Go compiles very quickly.
 Go supports concurrency at the language
level.
 Functions are first class objects in Go.
 Go has garbage collection.
 Strings and maps are built into the language.
 Go compiles to machine code.
 Go is very strongly typed.
 Go is not object oriented in the traditional
sense.
 A Go program basically consists of the
following parts:
 Package Declaration
 Import Packages
 Functions
 Variables
 Statements & Expressions
 Comments
 Let us look at a simple
 package main
 import "fmt"
 func main() {
 /* This is my first sample program. */
fmt.Println("Hello") }
 main defines the package name
 lineimport "fmt" is a preprocessor command
to include files in fmt package
 Lets look at how to save the source code in a file,
and how to compile and run it. Following are the
simple steps:
 Open a text editor and add the above-mentioned
code.
 Save the file as hello.go
 Open a command prompt and go to the directory
where you saved the file.
 Type go run hello.go and press enter to run your
code.
 If there are no errors in your code then you will
be able to see "Hello World" printed on the
screen.
 Performance is a key feature these days.
Performance means a better experience for end
users and fewer resources needed to power an
application.
 In testing for my types of use cases Go provides
the elegant use of multiple cores, loads of
features, and has faster performance than the
other languages that are a good fit for the
projects.
 Sometimes significantly faster performance. For
example, I've written tests in PHP and Go. Go can
compile and execute faster than PHP does it's
thing. I'll just put it this way… go compiles fast.
 Go is sometimes described as a ‘‘C-like
 language,’’ or as ‘‘C for the 21st century.’’
From C, Go inherited its expression syntax,
control-flow statements, basic data types,
call-by-value parameter passing, pointers,
and above all, C’s emphasis on programs that
compile to efficient machine code and
cooperate naturally wit h the abstractions of
cur rent operating systems.
 Go is a compiled language. The Go toolchain
converts a source program and the things it
depends on into instructions in the native
machine language of a computer.
 These tools are accessed through a single
command called go that has a number of sub
commands.
 The simplest of these sub command s is run,
which compiles the source code fro m on e or
more source files whose names end in
 The Go standard library has over 100
packages for common tasks like input and
out put, sorting, and text manipulation.
 For instance, the fmt package contains
functions for printing formatted output and
scanning input. Println is one of the basic out
put functions in fmt; it prints one or more
values, separated by spaces, wit h a newline
character at the end so that the values appear
as a single line of out put.

Go programing language

  • 1.
    Go - Overview Gooriginated as an experiment by Google engineers Robert Griesemer,Rob Pike, and Ken Thompson to design a new programming language that would resolve common criticisms of other languages while maintaining their positive characteristics
  • 2.
     Go compilesvery quickly.  Go supports concurrency at the language level.  Functions are first class objects in Go.  Go has garbage collection.  Strings and maps are built into the language.
  • 3.
     Go compilesto machine code.  Go is very strongly typed.  Go is not object oriented in the traditional sense.
  • 4.
     A Goprogram basically consists of the following parts:  Package Declaration  Import Packages  Functions  Variables  Statements & Expressions  Comments  Let us look at a simple
  • 5.
     package main import "fmt"  func main() {  /* This is my first sample program. */ fmt.Println("Hello") }  main defines the package name  lineimport "fmt" is a preprocessor command to include files in fmt package
  • 6.
     Lets lookat how to save the source code in a file, and how to compile and run it. Following are the simple steps:  Open a text editor and add the above-mentioned code.  Save the file as hello.go  Open a command prompt and go to the directory where you saved the file.  Type go run hello.go and press enter to run your code.  If there are no errors in your code then you will be able to see "Hello World" printed on the screen.
  • 7.
     Performance isa key feature these days. Performance means a better experience for end users and fewer resources needed to power an application.  In testing for my types of use cases Go provides the elegant use of multiple cores, loads of features, and has faster performance than the other languages that are a good fit for the projects.  Sometimes significantly faster performance. For example, I've written tests in PHP and Go. Go can compile and execute faster than PHP does it's thing. I'll just put it this way… go compiles fast.
  • 8.
     Go issometimes described as a ‘‘C-like  language,’’ or as ‘‘C for the 21st century.’’ From C, Go inherited its expression syntax, control-flow statements, basic data types, call-by-value parameter passing, pointers, and above all, C’s emphasis on programs that compile to efficient machine code and cooperate naturally wit h the abstractions of cur rent operating systems.
  • 9.
     Go isa compiled language. The Go toolchain converts a source program and the things it depends on into instructions in the native machine language of a computer.  These tools are accessed through a single command called go that has a number of sub commands.  The simplest of these sub command s is run, which compiles the source code fro m on e or more source files whose names end in
  • 10.
     The Gostandard library has over 100 packages for common tasks like input and out put, sorting, and text manipulation.  For instance, the fmt package contains functions for printing formatted output and scanning input. Println is one of the basic out put functions in fmt; it prints one or more values, separated by spaces, wit h a newline character at the end so that the values appear as a single line of out put.