From: Charles L. Dorian
The capacity, in number of elements, sets the size of the buffer in the channel. If the
-capacity is greater than zero, the channel is asynchronous: communication operations
+capacity is greater than zero, the channel is asynchronous: communication operations
succeed without blocking if the buffer is not full (sends) or not empty (receives),
and elements are received in the order they are sent.
If the capacity is zero or absent, the communication succeeds only when both a sender and
@@ -4326,7 +4326,7 @@ func complex_f3() (re float64, im float64) {
func (devnull) Write(p []byte) (n int, _ os.Error) {
n = len(p)
return
-}
+}
-is erroneous because the label Two built-in functions, break
,
continue
,
fallthrough
, or
return
++
,
--
,
@@ -1237,7 +1237,7 @@ make(chan int, 100)
L1
is inside
+is erroneous because the label L1
is inside
the "for" statement's block but the goto
is not.
panic
and recover
,
assist in reporting and handling run-time panics
-and program-defined error conditions.
+and program-defined error conditions.
@@ -4851,7 +4851,7 @@ run-time panics raised by
g
.
func protect(g func()) {
defer func() {
- log.Println("done") // Println executes normally even in there is a panic
+ log.Println("done") // Println executes normally even if there is a panic
if x := recover(); x != nil {
log.Printf("run time panic: %v", x)
}
@@ -5145,7 +5145,7 @@ A complete program is created by linking a single, unimported package
called the main package with all the packages it imports, transitively.
The main package must
have package name
main
and
-declare a function main
that takes no
+declare a function main
that takes no
arguments and returns no value.
main
) goroutines to complete.
-Package initialization—variable initialization and the invocation of
+Package initialization—variable initialization and the invocation of
init
functions—happens in a single goroutine,
sequentially, one package at a time.
An init
function may launch other goroutines, which can run