Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 894e5da861
Fetching contributors…

Cannot retrieve contributors at this time

92 lines (76 sloc) 3.912 kb
\epi{``Is Go an object-oriented language? Yes and no.''}
{\textit{Frequently asked questions}\\ \textsc{GO AUTHORS}}
\noindent{}This is an introduction to the Go language from Google. Its aim
is to provide a guide to this new and innovative language.
The intended audience of this book is people who are familiar with programming
and know some programming languages, be it C\cite{c}, C++\cite{c++},
Perl\cite{perl}, Java\cite{java}, Erlang\cite{erlang}, Scala\cite{scala} or
Haskell\cite{haskell}. This is \emph{not} a book which teaches you how to
program, this is a book that just teaches you how to use Go.
As with
learning new things, probably the best way to do this is to discover it for
yourself by creating your own programs.
Each chapter therefore includes a number of exercises (and answers)
to acquaint you with the language.
An exercise
is numbered as \textbf{Q$n$}, where $n$ is a number. After the
exercise number another number in parentheses displays the difficulty
of this particular assignment. This difficulty ranges from 0 to
9, where 0 is easy and 9 is difficult.
Then a short name is given, for easier reference.
For example:
\textbf{Q1}. (1) A map function \ldots
introduces a question numbered \textbf{Q1} of a level 1 difficulty, concerning a
\func{map()}-function. The answers are included after the exercises on a
new page.
The numbering and setup of the answers is identical to the
exercises, except that an answer starts with \textbf{A$n$}, where the
number $n$ corresponds with the number of the exercise. Some exercises
don't have an answer, they are marked with an asterisks.
\section*{Book layout}
\item[Chapter \ref{chap:intro}: \titleref{chap:intro}]
A short introduction and history of Go. It
tells how to get the source code of Go itself. It assumes a Unix-like environment, although
Go should be fully usable on Windows.
\item[Chapter \ref{chap:basics}: \titleref{chap:basics}]
Tells about the basic types, variables and control
structures available in the language.
\item[Chapter \ref{chap:functions}: \titleref{chap:functions}]
In the third chapter we look at functions, the basic building blocks of Go programs.
\item[Chapter \ref{chap:packages}: \titleref{chap:packages}]
In chapter \ref{chap:packages} we see that functions and data can be grouped together
in packages. You will also see how to document and test your packages.
\item[Chapter \ref{chap:beyond}: \titleref{chap:beyond}]
After that we look at creating your own types in chapter \ref{chap:beyond}. It also
looks at allocation in Go.
\item[Chapter \ref{chap:interfaces}: \titleref{chap:interfaces}]
Go does not support Object Orientation in the traditional sense.
In Go the central concept is interfaces.
\item[Chapter \ref{chap:channels}: \titleref{chap:channels}]
With the \func{go} keyword functions can be started in separate routines (called goroutines).
Communication with those goroutines is done via channels.
\item[Chapter \ref{chap:communication}: \titleref{chap:communication}]
In the last chapter we show how to interface with the rest of the world from within
a Go program. How create files and read and wrote from and to them. We also briefly
look into networking.
I hope you will enjoy this book and the language Go.
\section*{Settings used in this book}
\item Go itself is installed in \file{\~{}/go} ;
\item Go source code we want to compile ourself is placed in \file{\~{}/g/src} and
\var{\$GOPATH} is set to \var{GOPATH=\~{}/g} .
The content of this book is freely available. This has already led to translations:
\item Chinese, by Xing Xing: \url{}
\item Russian, \ldots
Miek Gieben, 2011, 2012 -- \url{}
Jump to Line
Something went wrong with that request. Please try again.