SYMBOL INDEX (523 symbols across 165 files) FILE: ch1/dup1/main.go function main (line 17) | func main() { FILE: ch1/dup2/main.go function main (line 17) | func main() { function countLines (line 40) | func countLines(f *os.File, counts map[string]int) { FILE: ch1/dup3/main.go function main (line 19) | func main() { FILE: ch1/echo1/main.go function main (line 15) | func main() { FILE: ch1/echo2/main.go function main (line 15) | func main() { FILE: ch1/echo3/main.go function main (line 16) | func main() { FILE: ch1/fetch/main.go function main (line 17) | func main() { FILE: ch1/fetchall/main.go function main (line 19) | func main() { function fetch (line 31) | func fetch(url string, ch chan<- string) { FILE: ch1/helloworld/main.go function main (line 12) | func main() { FILE: ch1/lissajous/main.go constant whiteIndex (line 34) | whiteIndex = 0 constant blackIndex (line 35) | blackIndex = 1 function main (line 38) | func main() { function lissajous (line 59) | func lissajous(out io.Writer) { FILE: ch1/server1/main.go function main (line 16) | func main() { function handler (line 22) | func handler(w http.ResponseWriter, r *http.Request) { FILE: ch1/server2/main.go function main (line 20) | func main() { function handler (line 27) | func handler(w http.ResponseWriter, r *http.Request) { function counter (line 35) | func counter(w http.ResponseWriter, r *http.Request) { FILE: ch1/server3/main.go function main (line 15) | func main() { function handler (line 22) | func handler(w http.ResponseWriter, r *http.Request) { FILE: ch10/cross/main.go function main (line 15) | func main() { FILE: ch10/jpeg/main.go function main (line 21) | func main() { function toJPEG (line 28) | func toJPEG(in io.Reader, out io.Writer) error { FILE: ch11/echo/echo.go function main (line 25) | func main() { function echo (line 33) | func echo(newline bool, sep string, args []string) error { FILE: ch11/echo/echo_test.go function TestEcho (line 15) | func TestEcho(t *testing.T) { FILE: ch11/storage1/storage.go function bytesInUse (line 18) | func bytesInUse(username string) int64 { return usage[username] } constant sender (line 22) | sender = "notifications@example.com" constant password (line 23) | password = "correcthorsebatterystaple" constant hostname (line 24) | hostname = "smtp.example.com" constant template (line 26) | template = `Warning: you are using %d bytes of storage, function CheckQuota (line 29) | func CheckQuota(username string) { FILE: ch11/storage2/quota_test.go function TestCheckQuotaNotifiesUser (line 12) | func TestCheckQuotaNotifiesUser(t *testing.T) { FILE: ch11/storage2/storage.go function bytesInUse (line 17) | func bytesInUse(username string) int64 { return usage[username] } constant sender (line 21) | sender = "notifications@example.com" constant password (line 22) | password = "correcthorsebatterystaple" constant hostname (line 23) | hostname = "smtp.example.com" constant template (line 25) | template = `Warning: you are using %d bytes of storage, function CheckQuota (line 38) | func CheckQuota(username string) { FILE: ch11/word1/word.go function IsPalindrome (line 12) | func IsPalindrome(s string) bool { FILE: ch11/word1/word_test.go function TestPalindrome (line 9) | func TestPalindrome(t *testing.T) { function TestNonPalindrome (line 18) | func TestNonPalindrome(t *testing.T) { function TestFrenchPalindrome (line 30) | func TestFrenchPalindrome(t *testing.T) { function TestCanalPalindrome (line 36) | func TestCanalPalindrome(t *testing.T) { FILE: ch11/word2/word.go function IsPalindrome (line 14) | func IsPalindrome(s string) bool { FILE: ch11/word2/word_test.go function TestIsPalindrome (line 19) | func TestIsPalindrome(t *testing.T) { function BenchmarkIsPalindrome (line 48) | func BenchmarkIsPalindrome(b *testing.B) { function ExampleIsPalindrome (line 58) | func ExampleIsPalindrome() { function randomPalindrome (line 78) | func randomPalindrome(rng *rand.Rand) string { function TestRandomPalindromes (line 89) | func TestRandomPalindromes(t *testing.T) { FILE: ch12/display/display.go function Display (line 17) | func Display(name string, x interface{}) { function formatAtom (line 26) | func formatAtom(v reflect.Value) string { function display (line 54) | func display(path string, v reflect.Value) { FILE: ch12/display/display_test.go function Example_expr (line 22) | func Example_expr() { function Example_slice (line 36) | func Example_slice() { function Example_nilInterface (line 44) | func Example_nilInterface() { function Example_ptrToInterface (line 52) | func Example_ptrToInterface() { function Example_struct (line 60) | func Example_struct() { function Example_interface (line 68) | func Example_interface() { function Example_ptrToInterface2 (line 76) | func Example_ptrToInterface2() { function Example_array (line 85) | func Example_array() { function Example_movie (line 93) | func Example_movie() { function Test (line 154) | func Test(t *testing.T) { FILE: ch12/format/format.go function Any (line 16) | func Any(value interface{}) string { function formatAtom (line 21) | func formatAtom(v reflect.Value) string { FILE: ch12/format/format_test.go function Test (line 14) | func Test(t *testing.T) { FILE: ch12/methods/methods.go function Print (line 17) | func Print(x interface{}) { FILE: ch12/methods/methods_test.go function ExamplePrintDuration (line 13) | func ExamplePrintDuration() { function ExamplePrintReplacer (line 24) | func ExamplePrintReplacer() { FILE: ch12/params/params.go function Unpack (line 21) | func Unpack(req *http.Request, ptr interface{}) error { function populate (line 65) | func populate(v reflect.Value, value string) error { FILE: ch12/search/main.go function search (line 20) | func search(resp http.ResponseWriter, req *http.Request) { function main (line 38) | func main() { FILE: ch12/sexpr/decode.go function Unmarshal (line 21) | func Unmarshal(data []byte, out interface{}) (err error) { type lexer (line 38) | type lexer struct method next (line 43) | func (lex *lexer) next() { lex.token = lex.scan.Scan() } method text (line 44) | func (lex *lexer) text() string { return lex.scan.TokenText() } method consume (line 46) | func (lex *lexer) consume(want rune) { function read (line 77) | func read(lex *lexer, v reflect.Value) { function readList (line 109) | func readList(lex *lexer, v reflect.Value) { function endList (line 152) | func endList(lex *lexer) bool { FILE: ch12/sexpr/encode.go function Marshal (line 16) | func Marshal(v interface{}) ([]byte, error) { function encode (line 28) | func encode(buf *bytes.Buffer, v reflect.Value) error { FILE: ch12/sexpr/pretty.go function MarshalIndent (line 15) | func MarshalIndent(v interface{}) ([]byte, error) { constant margin (line 23) | margin = 80 type token (line 25) | type token struct type printer (line 31) | type printer struct method string (line 41) | func (p *printer) string(str string) { method pop (line 50) | func (p *printer) pop() (top *token) { method begin (line 55) | func (p *printer) begin() { method end (line 64) | func (p *printer) end() { method space (line 79) | func (p *printer) space() { method print (line 91) | func (p *printer) print(t *token) { method stringf (line 110) | func (p *printer) stringf(format string, args ...interface{}) { function pretty (line 114) | func pretty(p *printer, v reflect.Value) error { FILE: ch12/sexpr/sexpr_test.go function Test (line 21) | func Test(t *testing.T) { FILE: ch13/bzip-print/bzip2.c function bz2compress (line 16) | int bz2compress(bz_stream *s, int action, FILE: ch13/bzip-print/bzip2.go type writer (line 29) | type writer struct method Write (line 50) | func (w *writer) Write(data []byte) (int, error) { method Close (line 75) | func (w *writer) Close() error { function NewWriter (line 36) | func NewWriter(out io.Writer) io.WriteCloser { FILE: ch13/bzip-print/bzip2_test.go function TestBzip2 (line 15) | func TestBzip2(t *testing.T) { FILE: ch13/bzip/bzip2.c function bz2compress (line 19) | int bz2compress(bz_stream *s, int action, FILE: ch13/bzip/bzip2.go type writer (line 45) | type writer struct method Write (line 64) | func (w *writer) Write(data []byte) (int, error) { method Close (line 89) | func (w *writer) Close() error { function NewWriter (line 52) | func NewWriter(out io.Writer) io.WriteCloser { FILE: ch13/bzip/bzip2_test.go function TestBzip2 (line 15) | func TestBzip2(t *testing.T) { FILE: ch13/bzipper/main.go function main (line 19) | func main() { FILE: ch13/equal/equal.go function equal (line 15) | func equal(x, y reflect.Value, seen map[comparison]bool) bool { function Equal (line 117) | func Equal(x, y interface{}) bool { type comparison (line 122) | type comparison struct FILE: ch13/equal/equal_test.go function TestEqual (line 12) | func TestEqual(t *testing.T) { function Example_equal (line 96) | func Example_equal() { function Example_equalCycle (line 111) | func Example_equalCycle() { FILE: ch13/unsafeptr/main.go function main (line 14) | func main() { FILE: ch2/boiling/main.go constant boilingF (line 12) | boilingF = 212.0 function main (line 14) | func main() { FILE: ch2/cf/main.go function main (line 18) | func main() { FILE: ch2/echo4/main.go function main (line 19) | func main() { FILE: ch2/ftoc/main.go function main (line 12) | func main() { function fToC (line 18) | func fToC(f float64) float64 { FILE: ch2/popcount/main.go function init (line 13) | func init() { function PopCount (line 20) | func PopCount(x uint64) int { FILE: ch2/popcount/popcount_test.go function BitCount (line 14) | func BitCount(x uint64) int { function PopCountByClearing (line 25) | func PopCountByClearing(x uint64) int { function PopCountByShifting (line 34) | func PopCountByShifting(x uint64) int { function BenchmarkPopCount (line 46) | func BenchmarkPopCount(b *testing.B) { function BenchmarkBitCount (line 52) | func BenchmarkBitCount(b *testing.B) { function BenchmarkPopCountByClearing (line 58) | func BenchmarkPopCountByClearing(b *testing.B) { function BenchmarkPopCountByShifting (line 64) | func BenchmarkPopCountByShifting(b *testing.B) { FILE: ch2/tempconv/conv.go function CToF (line 11) | func CToF(c Celsius) Fahrenheit { return Fahrenheit(c*9/5 + 32) } function FToC (line 14) | func FToC(f Fahrenheit) Celsius { return Celsius((f - 32) * 5 / 9) } FILE: ch2/tempconv/tempconv.go type Celsius (line 11) | type Celsius method String (line 20) | func (c Celsius) String() string { return fmt.Sprintf("%g°C", c) } type Fahrenheit (line 12) | type Fahrenheit method String (line 21) | func (f Fahrenheit) String() string { return fmt.Sprintf("%g°F", f) } constant AbsoluteZeroC (line 15) | AbsoluteZeroC Celsius = -273.15 constant FreezingC (line 16) | FreezingC Celsius = 0 constant BoilingC (line 17) | BoilingC Celsius = 100 FILE: ch2/tempconv0/celsius.go type Celsius (line 12) | type Celsius method String (line 27) | func (c Celsius) String() string { return fmt.Sprintf("%g°C", c) } type Fahrenheit (line 13) | type Fahrenheit constant AbsoluteZeroC (line 16) | AbsoluteZeroC Celsius = -273.15 constant FreezingC (line 17) | FreezingC Celsius = 0 constant BoilingC (line 18) | BoilingC Celsius = 100 function CToF (line 21) | func CToF(c Celsius) Fahrenheit { return Fahrenheit(c*9/5 + 32) } function FToC (line 23) | func FToC(f Fahrenheit) Celsius { return Celsius((f - 32) * 5 / 9) } FILE: ch2/tempconv0/tempconv_test.go function Example_one (line 8) | func Example_one() { function Example_two (line 27) | func Example_two() { FILE: ch3/basename1/main.go function main (line 15) | func main() { function basename (line 26) | func basename(s string) string { FILE: ch3/basename2/main.go function main (line 16) | func main() { function basename (line 27) | func basename(s string) string { FILE: ch3/comma/main.go function main (line 24) | func main() { function comma (line 32) | func comma(s string) string { FILE: ch3/mandelbrot/main.go function main (line 18) | func main() { function mandelbrot (line 37) | func mandelbrot(z complex128) color.Color { function acos (line 55) | func acos(z complex128) color.Color { function sqrt (line 62) | func sqrt(z complex128) color.Color { function newton (line 74) | func newton(z complex128) color.Color { FILE: ch3/netflag/netflag.go function IsUp (line 15) | func IsUp(v Flags) bool { return v&FlagUp == FlagUp } function TurnDown (line 16) | func TurnDown(v *Flags) { *v &^= FlagUp } function SetBroadcast (line 17) | func SetBroadcast(v *Flags) { *v |= FlagBroadcast } function IsCast (line 18) | func IsCast(v Flags) bool { return v&(FlagBroadcast|FlagMulticast) != 0 } function main (line 20) | func main() { FILE: ch3/printints/main.go function intsToString (line 16) | func intsToString(values []int) string { function main (line 29) | func main() { FILE: ch3/surface/main.go constant width (line 16) | width, height = 600, 320 constant cells (line 17) | cells = 100 constant xyrange (line 18) | xyrange = 30.0 constant xyscale (line 19) | xyscale = width / 2 / xyrange constant zscale (line 20) | zscale = height * 0.4 constant angle (line 21) | angle = math.Pi / 6 function main (line 26) | func main() { function corner (line 43) | func corner(i, j int) (float64, float64) { function f (line 57) | func f(x, y float64) float64 { FILE: ch4/append/main.go function appendslice (line 11) | func appendslice(x []int, y ...int) []int { function appendInt (line 32) | func appendInt(x []int, y int) []int { function main (line 55) | func main() { FILE: ch4/autoescape/main.go function main (line 16) | func main() { FILE: ch4/charcount/main.go function main (line 19) | func main() { FILE: ch4/dedup/main.go function main (line 16) | func main() { FILE: ch4/embed/main.go type Point (line 11) | type Point struct type Circle (line 13) | type Circle struct type Wheel (line 18) | type Wheel struct function main (line 23) | func main() { FILE: ch4/github/github.go constant IssuesURL (line 13) | IssuesURL = "https://api.github.com/search/issues" type IssuesSearchResult (line 15) | type IssuesSearchResult struct type Issue (line 20) | type Issue struct type User (line 30) | type User struct FILE: ch4/github/search.go function SearchIssues (line 17) | func SearchIssues(terms []string) (*IssuesSearchResult, error) { FILE: ch4/graph/main.go function addEdge (line 14) | func addEdge(from, to string) { function hasEdge (line 23) | func hasEdge(from, to string) bool { function main (line 29) | func main() { FILE: ch4/issues/main.go function main (line 19) | func main() { FILE: ch4/issueshtml/main.go function main (line 42) | func main() { FILE: ch4/issuesreport/main.go constant templ (line 19) | templ = `{{.TotalCount}} issues: function daysAgo (line 30) | func daysAgo(t time.Time) int { function main (line 41) | func main() { function noMust (line 53) | func noMust() { FILE: ch4/movie/main.go type Movie (line 16) | type Movie struct function main (line 35) | func main() { FILE: ch4/nonempty/main.go function nonempty (line 15) | func nonempty(strings []string) []string { function main (line 28) | func main() { function nonempty2 (line 37) | func nonempty2(strings []string) []string { FILE: ch4/rev/main.go function main (line 17) | func main() { function reverse (line 54) | func reverse(s []int) { FILE: ch4/sha256/main.go function main (line 14) | func main() { FILE: ch4/treesort/sort.go type tree (line 10) | type tree struct function Sort (line 16) | func Sort(values []int) { function appendValues (line 26) | func appendValues(values []int, t *tree) []int { function add (line 35) | func add(t *tree, value int) *tree { FILE: ch4/treesort/sort_test.go function TestSort (line 14) | func TestSort(t *testing.T) { FILE: ch5/defer1/defer.go function main (line 12) | func main() { function f (line 16) | func f(x int) { FILE: ch5/defer2/defer.go function main (line 16) | func main() { function printStack (line 21) | func printStack() { function f (line 29) | func f(x int) { FILE: ch5/fetch/main.go function fetch (line 20) | func fetch(url string) (filename string, n int64, err error) { function main (line 45) | func main() { FILE: ch5/findlinks1/main.go function main (line 17) | func main() { function visit (line 32) | func visit(links []string, n *html.Node) []string { FILE: ch5/findlinks2/main.go function visit (line 22) | func visit(links []string, n *html.Node) []string { function main (line 37) | func main() { function findLinks (line 52) | func findLinks(url string) ([]string, error) { FILE: ch5/findlinks3/findlinks.go function breadthFirst (line 21) | func breadthFirst(f func(item string) []string, worklist []string) { function crawl (line 38) | func crawl(url string) []string { function main (line 50) | func main() { FILE: ch5/links/links.go function Extract (line 19) | func Extract(url string) ([]string, error) { function forEachNode (line 57) | func forEachNode(n *html.Node, pre, post func(n *html.Node)) { FILE: ch5/outline/main.go function main (line 17) | func main() { function outline (line 26) | func outline(stack []string, n *html.Node) { FILE: ch5/outline2/outline.go function main (line 17) | func main() { function outline (line 23) | func outline(url string) error { function forEachNode (line 47) | func forEachNode(n *html.Node, pre, post func(n *html.Node)) { function startElement (line 66) | func startElement(n *html.Node) { function endElement (line 73) | func endElement(n *html.Node) { FILE: ch5/squares/main.go function squares (line 14) | func squares() func() int { function main (line 22) | func main() { FILE: ch5/sum/main.go function sum (line 12) | func sum(vals ...int) int { function main (line 22) | func main() { FILE: ch5/title1/title.go function forEachNode (line 32) | func forEachNode(n *html.Node, pre, post func(n *html.Node)) { function title (line 45) | func title(url string) error { function main (line 76) | func main() { FILE: ch5/title2/title.go function forEachNode (line 20) | func forEachNode(n *html.Node, pre, post func(n *html.Node)) { function title (line 33) | func title(url string) error { function main (line 66) | func main() { FILE: ch5/title3/title.go function forEachNode (line 19) | func forEachNode(n *html.Node, pre, post func(n *html.Node)) { function soleTitle (line 34) | func soleTitle(doc *html.Node) (title string, err error) { function title (line 67) | func title(url string) error { function main (line 93) | func main() { FILE: ch5/toposort/main.go function main (line 38) | func main() { function topoSort (line 44) | func topoSort(m map[string][]string) []string { FILE: ch5/trace/main.go function bigSlowOperation (line 15) | func bigSlowOperation() { function trace (line 21) | func trace(msg string) func() { function main (line 29) | func main() { FILE: ch5/wait/wait.go function WaitForServer (line 21) | func WaitForServer(url string) error { function main (line 37) | func main() { FILE: ch6/coloredpoint/main.go type Point (line 17) | type Point struct method Distance (line 26) | func (p Point) Distance(q Point) float64 { method ScaleBy (line 32) | func (p *Point) ScaleBy(factor float64) { type ColoredPoint (line 19) | type ColoredPoint struct function main (line 37) | func main() { function init (line 56) | func init() { function init (line 72) | func init() { FILE: ch6/geometry/geometry.go type Point (line 12) | type Point struct method Distance (line 20) | func (p Point) Distance(q Point) float64 { function Distance (line 15) | func Distance(p, q Point) float64 { type Path (line 29) | type Path method Distance (line 32) | func (path Path) Distance() float64 { FILE: ch6/intset/intset.go type IntSet (line 18) | type IntSet struct method Has (line 23) | func (s *IntSet) Has(x int) bool { method Add (line 29) | func (s *IntSet) Add(x int) { method UnionWith (line 38) | func (s *IntSet) UnionWith(t *IntSet) { method String (line 53) | func (s *IntSet) String() string { FILE: ch6/intset/intset_test.go function Example_one (line 8) | func Example_one() { function Example_two (line 33) | func Example_two() { FILE: ch6/urlvalues/main.go function main (line 38) | func main() { FILE: ch7/bytecounter/main.go type ByteCounter (line 15) | type ByteCounter method Write (line 17) | func (c *ByteCounter) Write(p []byte) (int, error) { function main (line 24) | func main() { FILE: ch7/eval/ast.go type Expr (line 7) | type Expr interface type Var (line 17) | type Var type literal (line 20) | type literal type unary (line 23) | type unary struct type binary (line 29) | type binary struct type call (line 35) | type call struct FILE: ch7/eval/check.go method Check (line 13) | func (v Var) Check(vars map[Var]bool) error { method Check (line 18) | func (literal) Check(vars map[Var]bool) error { method Check (line 22) | func (u unary) Check(vars map[Var]bool) error { method Check (line 29) | func (b binary) Check(vars map[Var]bool) error { method Check (line 39) | func (c call) Check(vars map[Var]bool) error { FILE: ch7/eval/coverage_test.go function TestCoverage (line 13) | func TestCoverage(t *testing.T) { FILE: ch7/eval/eval.go type Env (line 16) | type Env method Eval (line 22) | func (v Var) Eval(env Env) float64 { method Eval (line 26) | func (l literal) Eval(_ Env) float64 { method Eval (line 34) | func (u unary) Eval(env Env) float64 { method Eval (line 44) | func (b binary) Eval(env Env) float64 { method Eval (line 58) | func (c call) Eval(env Env) float64 { FILE: ch7/eval/eval_test.go function TestEval (line 13) | func TestEval(t *testing.T) { function TestErrors (line 78) | func TestErrors(t *testing.T) { FILE: ch7/eval/parse.go type lexer (line 16) | type lexer struct method next (line 21) | func (lex *lexer) next() { lex.token = lex.scan.Scan() } method text (line 22) | func (lex *lexer) text() string { return lex.scan.TokenText() } method describe (line 27) | func (lex *lexer) describe() string { type lexPanic (line 24) | type lexPanic function precedence (line 39) | func precedence(op rune) int { function Parse (line 59) | func Parse(input string) (_ Expr, err error) { function parseExpr (line 82) | func parseExpr(lex *lexer) Expr { return parseBinary(lex, 1) } function parseBinary (line 87) | func parseBinary(lex *lexer, prec1 int) Expr { function parseUnary (line 101) | func parseUnary(lex *lexer) Expr { function parsePrimary (line 114) | func parsePrimary(lex *lexer) Expr { FILE: ch7/eval/print.go function Format (line 13) | func Format(e Expr) string { function write (line 19) | func write(buf *bytes.Buffer, e Expr) { FILE: ch7/http1/main.go function main (line 17) | func main() { type dollars (line 22) | type dollars method String (line 24) | func (d dollars) String() string { return fmt.Sprintf("$%.2f", d) } type database (line 26) | type database method ServeHTTP (line 28) | func (db database) ServeHTTP(w http.ResponseWriter, req *http.Request) { FILE: ch7/http2/main.go function main (line 15) | func main() { type dollars (line 20) | type dollars method String (line 22) | func (d dollars) String() string { return fmt.Sprintf("$%.2f", d) } type database (line 24) | type database method ServeHTTP (line 27) | func (db database) ServeHTTP(w http.ResponseWriter, req *http.Request) { FILE: ch7/http3/main.go type dollars (line 16) | type dollars method String (line 18) | func (d dollars) String() string { return fmt.Sprintf("$%.2f", d) } function main (line 22) | func main() { type database (line 30) | type database method list (line 32) | func (db database) list(w http.ResponseWriter, req *http.Request) { method price (line 38) | func (db database) price(w http.ResponseWriter, req *http.Request) { FILE: ch7/http3a/main.go function main (line 16) | func main() { type database (line 26) | type database method list (line 28) | func (db database) list(w http.ResponseWriter, req *http.Request) { method price (line 34) | func (db database) price(w http.ResponseWriter, req *http.Request) { FILE: ch7/http4/main.go function main (line 18) | func main() { type dollars (line 27) | type dollars method String (line 29) | func (d dollars) String() string { return fmt.Sprintf("$%.2f", d) } type database (line 31) | type database method list (line 33) | func (db database) list(w http.ResponseWriter, req *http.Request) { method price (line 39) | func (db database) price(w http.ResponseWriter, req *http.Request) { FILE: ch7/sleep/sleep.go function main (line 18) | func main() { FILE: ch7/sorting/main.go type Track (line 18) | type Track struct function length (line 33) | func length(s string) time.Duration { function printTracks (line 44) | func printTracks(tracks []*Track) { type byArtist (line 58) | type byArtist method Len (line 60) | func (x byArtist) Len() int { return len(x) } method Less (line 61) | func (x byArtist) Less(i, j int) bool { return x[i].Artist < x[j].Arti... method Swap (line 62) | func (x byArtist) Swap(i, j int) { x[i], x[j] = x[j], x[i] } type byYear (line 67) | type byYear method Len (line 69) | func (x byYear) Len() int { return len(x) } method Less (line 70) | func (x byYear) Less(i, j int) bool { return x[i].Year < x[j].Year } method Swap (line 71) | func (x byYear) Swap(i, j int) { x[i], x[j] = x[j], x[i] } function main (line 75) | func main() { type customSort (line 145) | type customSort struct method Len (line 150) | func (x customSort) Len() int { return len(x.t) } method Less (line 151) | func (x customSort) Less(i, j int) bool { return x.less(x.t[i], x.t[j]) } method Swap (line 152) | func (x customSort) Swap(i, j int) { x.t[i], x.t[j] = x.t[j], x.t... function init (line 156) | func init() { FILE: ch7/surface/surface.go constant width (line 25) | width, height = 600, 320 constant cells (line 26) | cells = 100 constant xyrange (line 27) | xyrange = 30.0 constant xyscale (line 28) | xyscale = width / 2 / xyrange constant zscale (line 29) | zscale = height * 0.4 function corner (line 34) | func corner(f func(x, y float64) float64, i, j int) (float64, float64) { function surface (line 47) | func surface(w io.Writer, f func(x, y float64) float64) { function parseAndCheck (line 67) | func parseAndCheck(s string) (eval.Expr, error) { function plot (line 90) | func plot(w http.ResponseWriter, r *http.Request) { function main (line 107) | func main() { FILE: ch7/tempconv/tempconv.go type Celsius (line 14) | type Celsius method String (line 20) | func (c Celsius) String() string { return fmt.Sprintf("%g°C", c) } type Fahrenheit (line 15) | type Fahrenheit function CToF (line 17) | func CToF(c Celsius) Fahrenheit { return Fahrenheit(c*9.0/5.0 + 32.0) } function FToC (line 18) | func FToC(f Fahrenheit) Celsius { return Celsius((f - 32.0) * 5.0 / 9.0) } type celsiusFlag (line 36) | type celsiusFlag struct method Set (line 38) | func (f *celsiusFlag) Set(s string) error { function CelsiusFlag (line 60) | func CelsiusFlag(name string, value Celsius, usage string) *Celsius { FILE: ch7/tempflag/tempflag.go function main (line 19) | func main() { FILE: ch7/xmlselect/main.go function main (line 18) | func main() { function containsAll (line 43) | func containsAll(x, y []string) bool { FILE: ch8/cake/cake.go type Shop (line 19) | type Shop struct method baker (line 35) | func (s *Shop) baker(baked chan<- cake) { method icer (line 47) | func (s *Shop) icer(iced chan<- cake, baked <-chan cake) { method inscriber (line 57) | func (s *Shop) inscriber(iced <-chan cake) { method Work (line 71) | func (s *Shop) Work(runs int) { type cake (line 33) | type cake function work (line 86) | func work(d, stddev time.Duration) { FILE: ch8/cake/cake_test.go function Benchmark (line 22) | func Benchmark(b *testing.B) { function BenchmarkBuffers (line 29) | func BenchmarkBuffers(b *testing.B) { function BenchmarkVariable (line 37) | func BenchmarkVariable(b *testing.B) { function BenchmarkVariableBuffers (line 47) | func BenchmarkVariableBuffers(b *testing.B) { function BenchmarkSlowIcing (line 59) | func BenchmarkSlowIcing(b *testing.B) { function BenchmarkSlowIcingManyIcers (line 67) | func BenchmarkSlowIcingManyIcers(b *testing.B) { FILE: ch8/chat/chat.go type client (line 18) | type client function broadcaster (line 26) | func broadcaster() { function handleConn (line 50) | func handleConn(conn net.Conn) { function clientWriter (line 70) | func clientWriter(conn net.Conn, ch <-chan string) { function main (line 79) | func main() { FILE: ch8/clock1/clock.go function main (line 17) | func main() { function handleConn (line 32) | func handleConn(c net.Conn) { FILE: ch8/clock2/clock.go function handleConn (line 16) | func handleConn(c net.Conn) { function main (line 27) | func main() { FILE: ch8/countdown1/countdown.go function main (line 15) | func main() { function launch (line 27) | func launch() { FILE: ch8/countdown2/countdown.go function main (line 17) | func main() { function launch (line 44) | func launch() { FILE: ch8/countdown3/countdown.go function main (line 20) | func main() { function launch (line 49) | func launch() { FILE: ch8/crawl1/findlinks.go function crawl (line 23) | func crawl(url string) []string { function main (line 35) | func main() { FILE: ch8/crawl2/findlinks.go function crawl (line 25) | func crawl(url string) []string { function main (line 40) | func main() { FILE: ch8/crawl3/findlinks.go function crawl (line 21) | func crawl(url string) []string { function main (line 31) | func main() { FILE: ch8/du1/main.go function main (line 19) | func main() { function printDiskUsage (line 45) | func printDiskUsage(nfiles, nbytes int64) { function walkDir (line 55) | func walkDir(dir string, fileSizes chan<- int64) { function dirents (line 67) | func dirents(dir string) []os.FileInfo { FILE: ch8/du2/main.go function main (line 24) | func main() { function printDiskUsage (line 69) | func printDiskUsage(nfiles, nbytes int64) { function walkDir (line 75) | func walkDir(dir string, fileSizes chan<- int64) { function dirents (line 87) | func dirents(dir string) []os.FileInfo { FILE: ch8/du3/main.go function main (line 26) | func main() { function printDiskUsage (line 79) | func printDiskUsage(nfiles, nbytes int64) { function walkDir (line 86) | func walkDir(dir string, n *sync.WaitGroup, fileSizes chan<- int64) { function dirents (line 106) | func dirents(dir string) []os.FileInfo { FILE: ch8/du4/main.go function cancelled (line 23) | func cancelled() bool { function main (line 34) | func main() { function printDiskUsage (line 89) | func printDiskUsage(nfiles, nbytes int64) { function walkDir (line 96) | func walkDir(dir string, n *sync.WaitGroup, fileSizes chan<- int64) { function dirents (line 121) | func dirents(dir string) []os.FileInfo { FILE: ch8/netcat1/netcat.go function main (line 17) | func main() { function mustCopy (line 26) | func mustCopy(dst io.Writer, src io.Reader) { FILE: ch8/netcat2/netcat.go function main (line 17) | func main() { function mustCopy (line 29) | func mustCopy(dst io.Writer, src io.Reader) { FILE: ch8/netcat3/netcat.go function main (line 17) | func main() { function mustCopy (line 35) | func mustCopy(dst io.Writer, src io.Reader) { FILE: ch8/pipeline1/main.go function main (line 12) | func main() { FILE: ch8/pipeline2/main.go function main (line 12) | func main() { FILE: ch8/pipeline3/main.go function counter (line 13) | func counter(out chan<- int) { function squarer (line 20) | func squarer(out chan<- int, in <-chan int) { function printer (line 27) | func printer(in <-chan int) { function main (line 33) | func main() { FILE: ch8/reverb1/reverb.go function echo (line 19) | func echo(c net.Conn, shout string, delay time.Duration) { function handleConn (line 27) | func handleConn(c net.Conn) { function main (line 38) | func main() { FILE: ch8/reverb2/reverb.go function echo (line 18) | func echo(c net.Conn, shout string, delay time.Duration) { function handleConn (line 27) | func handleConn(c net.Conn) { function main (line 38) | func main() { FILE: ch8/spinner/main.go function main (line 15) | func main() { function spinner (line 22) | func spinner(delay time.Duration) { function fib (line 31) | func fib(x int) int { FILE: ch8/thumbnail/main.go function main (line 29) | func main() { FILE: ch8/thumbnail/thumbnail.go function Image (line 21) | func Image(src image.Image) image.Image { function ImageStream (line 49) | func ImageStream(w io.Writer, r io.Reader) error { function ImageFile2 (line 60) | func ImageFile2(outfile, infile string) (err error) { function ImageFile (line 82) | func ImageFile(infile string) (string, error) { FILE: ch8/thumbnail/thumbnail_test.go function makeThumbnails (line 19) | func makeThumbnails(filenames []string) { function makeThumbnails2 (line 31) | func makeThumbnails2(filenames []string) { function makeThumbnails3 (line 41) | func makeThumbnails3(filenames []string) { function makeThumbnails4 (line 61) | func makeThumbnails4(filenames []string) error { function makeThumbnails5 (line 86) | func makeThumbnails5(filenames []string) (thumbfiles []string, err error) { function makeThumbnails6 (line 117) | func makeThumbnails6(filenames <-chan string) int64 { FILE: ch9/bank1/bank.go function Deposit (line 13) | func Deposit(amount int) { deposits <- amount } function Balance (line 14) | func Balance() int { return <-balances } function teller (line 16) | func teller() { function init (line 27) | func init() { FILE: ch9/bank1/bank_test.go function TestBank (line 13) | func TestBank(t *testing.T) { FILE: ch9/bank2/bank.go function Deposit (line 15) | func Deposit(amount int) { function Balance (line 21) | func Balance() int { FILE: ch9/bank2/bank_test.go function TestBank (line 13) | func TestBank(t *testing.T) { FILE: ch9/bank3/bank.go function Deposit (line 17) | func Deposit(amount int) { function Balance (line 23) | func Balance() int { FILE: ch9/bank3/bank_test.go function TestBank (line 13) | func TestBank(t *testing.T) { FILE: ch9/memo1/memo.go type Memo (line 13) | type Memo struct method Get (line 31) | func (memo *Memo) Get(key string) (interface{}, error) { type Func (line 19) | type Func type result (line 21) | type result struct function New (line 26) | func New(f Func) *Memo { FILE: ch9/memo1/memo_test.go function Test (line 15) | func Test(t *testing.T) { function TestConcurrent (line 21) | func TestConcurrent(t *testing.T) { FILE: ch9/memo2/memo.go type Func (line 13) | type Func type result (line 15) | type result struct function New (line 20) | func New(f Func) *Memo { type Memo (line 26) | type Memo struct method Get (line 33) | func (memo *Memo) Get(key string) (value interface{}, err error) { FILE: ch9/memo2/memo_test.go function Test (line 15) | func Test(t *testing.T) { function TestConcurrent (line 20) | func TestConcurrent(t *testing.T) { FILE: ch9/memo3/memo.go type Memo (line 13) | type Memo struct method Get (line 32) | func (memo *Memo) Get(key string) (value interface{}, err error) { type Func (line 19) | type Func type result (line 21) | type result struct function New (line 26) | func New(f Func) *Memo { FILE: ch9/memo3/memo_test.go function Test (line 15) | func Test(t *testing.T) { function TestConcurrent (line 20) | func TestConcurrent(t *testing.T) { FILE: ch9/memo4/memo.go type Func (line 15) | type Func type result (line 17) | type result struct type entry (line 23) | type entry struct function New (line 28) | func New(f Func) *Memo { type Memo (line 32) | type Memo struct method Get (line 38) | func (memo *Memo) Get(key string) (value interface{}, err error) { FILE: ch9/memo4/memo_test.go function Test (line 15) | func Test(t *testing.T) { function TestConcurrent (line 20) | func TestConcurrent(t *testing.T) { FILE: ch9/memo5/memo.go type Func (line 15) | type Func type result (line 18) | type result struct type entry (line 23) | type entry struct method call (line 74) | func (e *entry) call(f Func, key string) { method deliver (line 81) | func (e *entry) deliver(response chan<- result) { type request (line 33) | type request struct type Memo (line 38) | type Memo struct method Get (line 47) | func (memo *Memo) Get(key string) (interface{}, error) { method Close (line 54) | func (memo *Memo) Close() { close(memo.requests) } method server (line 60) | func (memo *Memo) server(f Func) { function New (line 41) | func New(f Func) *Memo { FILE: ch9/memo5/memo_test.go function Test (line 15) | func Test(t *testing.T) { function TestConcurrent (line 21) | func TestConcurrent(t *testing.T) { FILE: ch9/memotest/memotest.go function httpGetBody (line 21) | func httpGetBody(url string) (interface{}, error) { function incomingURLs (line 34) | func incomingURLs() <-chan string { type M (line 54) | type M interface function Sequential (line 64) | func Sequential(t *testing.T, m M) { function Concurrent (line 85) | func Concurrent(t *testing.T, m M) {