go-lang-book-solutions

module
v0.0.0-...-a8a07f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2022 License: MIT

README

The-Go-Programming-Language

Code and exercises from The Go Programming Language by Alan A.A Donovan and Brian W. Kernighan

Table of Contexts

  • Chapter 1: Tutorial
  • Chapter 2: Program Structure
  • Chapter 3: Basic Data Types
  • Chapter 4: Composite Types
  • Chapter 5: Functions
  • Chapter 6: Methods
  • Chapter 7: Interfaces
  • Chapter 8: Goroutines and Channels
  • Chapter 9: Concurrency with Shared Variables
  • Chapter 10: Packages and the Go Tool
  • Chapter 11: Testing
  • Chapter 12: Reflection
  • Chapter 13: Low-Level Programming

Directories

Path Synopsis
Chapter-10
ex10.1
ex10.1 converts images to between jpg, png, and gif formats.
ex10.1 converts images to between jpg, png, and gif formats.
ex10.2
ex10.2 detects and reads zip and tar archives.
ex10.2 detects and reads zip and tar archives.
ex10.2/cmd/arprint
Print the names and contents of the files in a tar or zip archive.
Print the names and contents of the files in a tar or zip archive.
ex10.4
ex10.4 lists go packages that transitively depend on the given packages.
ex10.4 lists go packages that transitively depend on the given packages.
Chapter-11
ex11.1
ex11.1 computes counts of Unicode characters, and includes tests.
ex11.1 computes counts of Unicode characters, and includes tests.
ex11.2
Package intset provides a set of integers based on a bit vector.
Package intset provides a set of integers based on a bit vector.
ex11.3
ex11.3 tests IsPalindrome on random non-palindromes.
ex11.3 tests IsPalindrome on random non-palindromes.
ex11.4
ex11.4 tests IsPalindrome on strings including punctuation.
ex11.4 tests IsPalindrome on strings including punctuation.
ex11.7
Package intset provides a set of integers based on a bit vector.
Package intset provides a set of integers based on a bit vector.
Chapter-12
ex12.1
ex12.1 uses reflection to print arbitrary values.
ex12.1 uses reflection to print arbitrary values.
ex12.10
ex12.10 is a s-expression codec that can decode booleans, floating point numbers, and registered interface values.
ex12.10 is a s-expression codec that can decode booleans, floating point numbers, and registered interface values.
ex12.11
ex12.11 provides a reflection-based codec for URL query parameters.
ex12.11 provides a reflection-based codec for URL query parameters.
ex12.12
ex12.12 provides a URL query parameter codec with validation triggered by struct tags.
ex12.12 provides a URL query parameter codec with validation triggered by struct tags.
ex12.13
ex12.13 is a s-expression codec that uses names found in struct tags.
ex12.13 is a s-expression codec that uses names found in struct tags.
ex12.2
ex12.2 displays arbitrary values to a certain depth.
ex12.2 displays arbitrary values to a certain depth.
ex12.3
ex12.3 is a codec for s-expressions.
ex12.3 is a codec for s-expressions.
ex12.4
ex12.4 is a codec for s-expressions, with pretty-printing.
ex12.4 is a codec for s-expressions, with pretty-printing.
ex12.5
ex12.5 is a codec for json.
ex12.5 is a codec for json.
ex12.6
ex12.6 is an s-expression codec that doesn't encode zero values.
ex12.6 is an s-expression codec that doesn't encode zero values.
ex12.7
ex12.7 provides a streaming decoder for s-expressions.
ex12.7 provides a streaming decoder for s-expressions.
ex12.8
ex12.8 can unmarshall s-expressions from an io.Reader.
ex12.8 can unmarshall s-expressions from an io.Reader.
ex12.9
ex12.9 is a token-based API for decoding s-expressions.
ex12.9 is a token-based API for decoding s-expressions.
Chapter-13
ex13.1
ex13.1 provides a deep equivalence relation for arbitrary values.
ex13.1 provides a deep equivalence relation for arbitrary values.
ex13.2
ex13.2 determines if a value is cyclic.
ex13.2 determines if a value is cyclic.
ex13.3
ex13.3 bzip provides a concurrency-safe writer that uses bzip2 compression.
ex13.3 bzip provides a concurrency-safe writer that uses bzip2 compression.
ex13.4
ex13.4 provides a bzip2 writer using the system's bzip2 binary.
ex13.4 provides a bzip2 writer using the system's bzip2 binary.
Issues prints a table of Github issues matching the search terms.
Issues prints a table of Github issues matching the search terms.
Chapter-6
ex6.1
ex6.1 is a bit vector integer set.
ex6.1 is a bit vector integer set.
ex6.2
ex6.2 is a integer set with a variadic AddAll method.
ex6.2 is a integer set with a variadic AddAll method.
ex6.3
ex6.3 is a bit vector integer set with binary set operations.
ex6.3 is a bit vector integer set with binary set operations.
ex6.4
ex6.4 is an integer set with an Elems method.
ex6.4 is an integer set with an Elems method.
ex6.5
ex6.5 is a variable-word-size bit vector intset.
ex6.5 is a variable-word-size bit vector intset.
Chapter-7
ex7.1
ex7.1 provides line and word counters.
ex7.1 provides line and word counters.
ex7.10
ex7.10 uses sort.Interface to detect palindromes.
ex7.10 uses sort.Interface to detect palindromes.
ex7.11
ex7.11 adds CRUD http endpoints to a simple PriceDB server.
ex7.11 adds CRUD http endpoints to a simple PriceDB server.
ex7.12
ex7.12 convert's PriceDB list output to an html table.
ex7.12 convert's PriceDB list output to an html table.
ex7.13
ex7.13 adds pretty-printing to an arithmetic expression parser.
ex7.13 adds pretty-printing to an arithmetic expression parser.
ex7.14
ex7.14 adds factorials to an arithmetic expression parser.
ex7.14 adds factorials to an arithmetic expression parser.
ex7.15
ex7.15 evaluates an expression using given variable bindings.
ex7.15 evaluates an expression using given variable bindings.
ex7.16
ex7.16 is a web-based calculator.
ex7.16 is a web-based calculator.
ex7.17
ex7.17 provides CSS-style selectors for XML.
ex7.17 provides CSS-style selectors for XML.
ex7.18
ex7.18 parses XML into a tree of nodes, using the token-based API of encoding/xml.
ex7.18 parses XML into a tree of nodes, using the token-based API of encoding/xml.
ex7.2
ex7.2 wraps a writer to count written words.
ex7.2 wraps a writer to count written words.
ex7.3
ex7.3 provides insertion sort using an unbalanced binary tree, and a String method to visualize the tree.
ex7.3 provides insertion sort using an unbalanced binary tree, and a String method to visualize the tree.
ex7.4
ex7.4 provides a simple string reader.
ex7.4 provides a simple string reader.
ex7.5
ex7.5 provides a LimitReader that reports EOF at a given offset.
ex7.5 provides a LimitReader that reports EOF at a given offset.
ex7.6
ex7.6 prints flag arguments for different temperature scales, including Kelvin.
ex7.6 prints flag arguments for different temperature scales, including Kelvin.
ex7.8
ex7.8 provides iterative columnar sorting for Persons.
ex7.8 provides iterative columnar sorting for Persons.
ex7.9
ex7.9 serves an html table with a stable column sort.
ex7.9 serves an html table with a stable column sort.
Chapter-8
ex8.1/clock
clock is a TCP server that periodically writes the time.
clock is a TCP server that periodically writes the time.
ex8.1/clockwall
clockwall listens to multiple clock servers concurrently.
clockwall listens to multiple clock servers concurrently.
ex8.10
ex8.10 is a web-mirroring tool that can be gracefully interrupted using ctrl-c.
ex8.10 is a web-mirroring tool that can be gracefully interrupted using ctrl-c.
ex8.11
ex8.11 prints the first HTTP response received.
ex8.11 prints the first HTTP response received.
ex8.12
ex8.12 is a server that lets clients chat with each other.
ex8.12 is a server that lets clients chat with each other.
ex8.13
ex8.13 is a chat server that disconnects inactive clients.
ex8.13 is a chat server that disconnects inactive clients.
ex8.14
ex8.14 is a chat server that prompts clients for a name upon connection.
ex8.14 is a chat server that prompts clients for a name upon connection.
ex8.15
ex8.15 is a chat server that skips clients that are slow to process writes.
ex8.15 is a chat server that skips clients that are slow to process writes.
ex8.2
ex8.2 is a minimal ftp server as per section 5.1 of RFC 959.
ex8.2 is a minimal ftp server as per section 5.1 of RFC 959.
ex8.3
ex8.3 is a simple read/write client for TCP servers.
ex8.3 is a simple read/write client for TCP servers.
ex8.4
ex8.4 is a reverb server that uses sync.WaitGroup to choose when to close connections.
ex8.4 is a reverb server that uses sync.WaitGroup to choose when to close connections.
ex8.5
ex8.5 is a parallellized Mandelbrot fractal generator.
ex8.5 is a parallellized Mandelbrot fractal generator.
ex8.6
ex8.6 is a depth-limited web crawler.
ex8.6 is a depth-limited web crawler.
ex8.7
ex8.7 mirrors a website to a given depth using multiple goroutines and rewrites local links.
ex8.7 mirrors a website to a given depth using multiple goroutines and rewrites local links.
ex8.8
ex8.8 is a reverb server that disconnects inactive clients.
ex8.8 is a reverb server that disconnects inactive clients.
ex8.9
ex8.9 is a concurrent du clone.
ex8.9 is a concurrent du clone.
Chapter-9
ex9.1
ex9.1 provides a concurrency-safe bank, with withdrawals.
ex9.1 provides a concurrency-safe bank, with withdrawals.
ex9.3
ex9.3 provides cancellable memoization of a function.
ex9.3 provides cancellable memoization of a function.
ex9.4
ex9.4 tests the performance of goroutine pipelines.
ex9.4 tests the performance of goroutine pipelines.
ex9.5
ex9.5 tests of performance of ping-ponging goroutines.
ex9.5 tests of performance of ping-ponging goroutines.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL