Tuesday, January 22, 2013

GOOGLE GO PROGRAMMING LANGUAGE (GOLANG) WORKSPACE

GO (GOLANG) WORKSPACE



REVISED: Friday, March 1, 2013




In this tutorial, you will learn about the Google Go programming language workspace.

I. GO WORKSPACE INTRODUCTION

Google GO programming language workspace directory structure.

A. bin

The bin is a package subdirectory containing executable binaries, created by the GO tool.

B. pkg

All GO code belongs to a package. GO programs begin with function main inside package main which signifies an executable command. The pkg is a package subdirectory containing compiled object files, created by the GO tool. The address referencing a command line subdirectory, must include all directories above it.

C. src

The src is a package subdirectory containing source code, which you create.

II. GOPATH ENVIRONMENT VARIABLE

Tell the GO tool where your workspace is by setting the GOPATH environment variable by going to your control panel and select system. Next, select advanced system settings. Then select environmental variables. Next, select system variables, then select edit, and then select path. Move your cursor to the very end of the path line, type a semicolon ; and then type the path to your GO bin subdirectory, for example, my path using Windows  is as follows:

c:\go\bin\ 

After you enter the path to your GO bin subdirectory, keep pressing OK until you exit out of the control panel.

In this tutorial, you have learned about the Google Go programming language workspace.


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"




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"




Tuesday, December 11, 2012

DOWNLOADING AND INSTALLING GO (GOLANG)

DOWNLOADING AND INSTALLING GO (GOLANG)



REVISED: Friday, September 25, 2020




Google Golang.

I. DOWNLOADING AND INSTALLING GO

Link to download the Google Golang:

 Go.

II. DOWNLOADING AND INSTALLING ECLIPSE

You will need an integrated development environment (IDE) to program in Go. An IDE is a software application that provides comprehensive facilities to computer programmers for software development. An IDE is a debugger, source code editor, and build automation tools. Microsoft Visual Studio and Eclipse IDEs include both an interpreter and a compiler. I will talk you through downloading Eclipse; however, you can use any IDE you prefer. If you do not already have Eclipse, to download Eclipse, click on the following link:

 Eclipse.

III. DOWNLOADING AND INSTALLING THE GO ECLIPSE PLUGIN

To download the Go Eclipse Plugin, click on the following link:

 Go Eclipse Plugin.

For example I selected Eclipse 4.2 (Juno) by copying http://dl.google.com/eclipse/plugin/4.2 which I will have to paste into my Juno Eclipse. Detailed instructions for installing the Plugin are at the bottom of the page. Select the instructions that match your copy of Eclipse. For example, I selected Google Plugin for Eclipse 4.2 (Juno).

IV. TESTING GO DOWNLOAD AND INSTALLATION

Copy the following Go program into Eclipse and run:

package main

import "fmt"

func main() {
    fmt.Printf("Hello World!\n")
}

Go output:

Hello World!

When you receive the above output, "Hello World!", the test was successful and you are ready to write Go programs, congratulations.

You now have the Google Golang; have fun.


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"