Agus Kurniawan - Go Programming by Example
Here you can read online Agus Kurniawan - Go Programming by Example full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2015, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:
Romance novel
Science fiction
Adventure
Detective
Science
History
Home and family
Prose
Art
Politics
Computer
Non-fiction
Religion
Business
Children
Humor
Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.
- Book:Go Programming by Example
- Author:
- Genre:
- Year:2015
- Rating:5 / 5
- Favourites:Add to favourites
- Your mark:
- 100
- 1
- 2
- 3
- 4
- 5
Go Programming by Example: summary, description and annotation
We offer to read an annotation, description, summary or preface (depends on what the author of the book "Go Programming by Example" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.
Go Programming by Example — read online for free the complete book (whole text) full work
Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Go Programming by Example" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.
Font size:
Interval:
Bookmark:
Go Programming by Example
Agus Kurniawan
1st Edition, 2015
Copyright 2015 Agus Kurniawan
* Cover photo is credit to Fajar Ramadhany, Bataviasoft, http://bataviasoft.com/.
** Go logo is taken from https://blog.golang.org/gopher .
This chapter explains introduction of Go. The official web of Go could be found on https://golang.org/. What is Go? Based on information from website, we could know what it is. Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Installation of Go application is easy. For Windows and Mac Platform, you download setup file from Go website, http://golang.org/doc/install. Run it and follow installation commands.
The next step is to configure GOROOT path. For Windows platform, you can add GOROOT variable on Environment Variables. For Mac/Linux, you can it on your bash profile.
For Windows platform, you can add GO installation path, for instance my Go installation path is c:/go/bin, into PATH variable on Environment Variables.
After configured, you can verify Go version by typing this command on your Terminal or CMD for Windows.
A sample output can be seen in Figure below, Mac platform.
The output of program on Windows platform.
Basically, you can use any text editor to write Go code. The following is a list of text editor:
- vim
- nano
- Intellij IDEA, https://www.jetbrains.com/idea/
- Sublime text, http://www.sublimetext.com/
A sample screenshot for Intellij IDEA is shown in Figure below.
How to get started with Go? well, it is easy. Firstly, create a folder, called hello.
Then, create a file, called main.go, on the hello folder. Write this code for main.go file.
Save this file. Then, back to your Terminal. You can build and run it.
In this case, it will generate an executable file based on your platform.
A sample program output can be seen in Figure below.
There are a lot of Go packages that you can use. The list of Go packages can seen on this link https://golang.org/pkg/. In this book, we will explore some Go standard packages. We also try to build own Go package.
This chapter explains the basic of Go programming language.
Go language uses "C family" as primary language but we don't write ";" at the end of syntax. Here is the syntax rule:
In this section, we explore how to define a variable and assign its value.
To declare a variable called myvar and data type is data_type1, you can write the following script:
The following is a sample script to declare some variables.
We also can define multiple variables as follows.
Once declared, these variables can be used to store any type data.
Variable that you already declare can be assigned by a value. It can done using the equals sign (=). For example, variable str will assign a string value "Hello World", you would write this:
We also can declare a variable and assign its value.
Another option, we can declare a variable with defining data type using := syntax. Assign it with a value.
For illustration for declaring variables using Go, create a folder, called vardemo. Then, create a file, called main.go.
Write the following script for main.go.
Save this file.
Then, try to build and run it.
A sample output can be seen in Figure below.
You may explain how to work on your code with writing comments. To do it, you can use // and /* */ syntax. Here is sample code:
Go supports the same four basic arithmetic operations such as addition, subtraction, multiplication, and division. For testing, create a folder arithdemo. Then, create a file, called main.go.
The following is the code illustration for basic arithmetic in main.go:
Font size:
Interval:
Bookmark:
Similar books «Go Programming by Example»
Look at similar books to Go Programming by Example. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.
Discussion, reviews of the book Go Programming by Example and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.