Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
djotto committed Sep 7, 2012
1 parent 7c8a0ec commit 1f8dae0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions go-functions.tex
Expand Up @@ -284,7 +284,7 @@ \section{Functions as values}
If we use \lstinline{fmt.Printf("%T\n", a)} to print the type of
\var{a}, it prints \func{func()}.

Functions--as--values may also be used in other places, like in maps.
Functions--as--values may be used in other places, for example maps.
Here we convert from integers to functions:
\begin{lstlisting}[caption=Functions as values in maps]
var xs = map[int]func() int{
Expand All @@ -301,7 +301,7 @@ \section{Functions as values}

\section{Callbacks}
\label{sec:callbacks}
With functions as values they are easy to pass to functions, from where
Because functions are values they are easy to pass to functions, from where
they can be used as callbacks. First define a function that
does ``something'' with an integer value:
\begin{lstlisting}
Expand All @@ -320,7 +320,7 @@ \section{Callbacks}

\section{Panic and recovering}
\label{sec:panic}
Go does not have an exception mechanism, like that in Java for instance: you can not throw exceptions.
Go does not have an exception mechanism, like that in Java for instance: you cannot throw exceptions.
Instead it uses a panic-and-recover mechanism. It is worth remembering that you should use this as
a last resort, your code will not look, or be, better if it is littered with panics. It's a powerful tool:
use it wisely. So, how do you use it?
Expand Down

0 comments on commit 1f8dae0

Please sign in to comment.