gonow has changed to
https://github.com/kisom/GoNow.
Gary Scarr333 at the bottom should be two spaces to
the right.
Authorkeyword!!struct; this should be deleted.
Mikhail Strebkoviota, Cyan must be given an explicit value, and
Magenta would be set to Cyan's value and
Yellow would be set to Magenta's value. So, if
Cyan was set to, say 9, then they would all be set to 9. We can
use both iota and explicit values. For example, we could set
Cyan to iota (so its value will be 0), give no value
to Magenta (so it becomes 1 due to Cyan's
iota), and Yellow to 5. If we then added
Black it would have the previous constant's value (i.e.,
Yellow's 5), unless we gave it an explicit value."
Luca Boassoutf.DecodeLastRuneInString() should, of course, be
utf8.DecodeLastRuneInString().
Luca Boassopi := &y (i.e., the third column's value) should be
22 not y.
Darin GreahamcomputeIndent() function will
hang if the indent isn't exactly four spaces. To fix this,
increment i just before the first return call:
if char != whitespace {
i++ // FIX: will now work for any non-zero indent
return strings.Repeat(string(whitespace), i), i
}
This correction has been made to the indent_sort/indent_sort.go
file in the archive files. (Note that the function will fail if the data
has no or inconsistent indentation.)
Alexander Häckel| Program | Time | Notes |
|---|---|---|
| apachereport1 | 13.8s | The file is read in one goroutine which feeds lines to four other goroutines who populate a safe map in its own goroutine. |
| apachereport2 | 13.9s | The file is read in one goroutine which feeds lines to four other goroutines who populate a map which is protected by a mutex. |
| apachereport3 | 14.8s | The file is read in one goroutine which feeds lines to four other goroutines who populate their own independent maps which are merged as each worker goroutine finishes. |
| apachereport4 | 11.5s | The file is read in one goroutine which feeds lines to four other goroutines who populate a safe slice in its own goroutine. |
| apachereport5 | 07.4s | Four goroutines each open the same file and read lines from their own quarter of it. They populate their own independent maps which are merged as each worker goroutine finishes. (This example was added after the book was published; it is now included with the book's source code.) |
Keen experimenters might like to do their own timings and then create
new versions (e.g., apachereport6 based on
apachereport1 and apachereport7 based on
apachereport2 etc.), but where each goroutine opens the same
file and reads in its own lines like apachereport5 does.
Your Privacy • Copyright © 2006 Mark Summerfield. All Rights Reserved. Patent Free