golang-exercise

module
v0.0.0-...-4939c6e Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2019 License: Apache-2.0

README

Programming in Go by Mark Summerfield

ISBN: 0321774639

Copyright © 2011-12 Qtrac Ltd.

All the book's examples are designed to be educational, and many are also designed to be useful. I hope that you find them helpful, and are perhaps able to use some of them as starting points for your own projects.

On Unix-like systems (e.g., Linux, FreeBSD, Mac OS X), once you have installed Go, you can build all the examples in one go by executing:

$ cd $HOME/goeg
$ ./build.sh

On Windows it works similarly:

C:\>cd goeg
C:\goeg>build.bat

The build.sh (Unix) or build.bat (Windows) script sets GOPATH temporarily just for the build and uses the go command (go build); both assume that the go command (i.e., Go's bin directory) is in the PATH which it will be if you installed a binary version.

If you want to build the examples individually and build your own Go programs you will need to set GOPATH. This can be done temporarily by running the accompanying gopath.sh (Unix) or gopath.bat (Windows) script (after editing to change any paths to match your setup), or permanently by adding the export lines from gopath.sh to your .bashrc file or on Windows by creating a Go-specific console shortcut: see gopath.sh or gopath.bat for more information.

Here is the list of programs and packages referred to in the book grouped by chapter:

Chapter 1: An Overview in Five Examples

hello
bigdigits
stack
americanize
polar2cartesian
bigdigits_ans

Chapter 2: Identifiers, Booleans, and Numbers

pi_by_digits
statistics
statistics_ans
quadratic_ans1
quadratic_ans2

Chapter 3: Strings

m3u2pls
playlist
soundex

Chapter 4: Collection Types

guess_separator
wordfrequency
chap4_ans

Chapter 5: Procedural Programming

archive_file_list
archive_file_list_ans
statistics_nonstop
statistics_nonstop2
contains
palindrome
palindrome_ans
memoize
indent_sort
common_prefix

Chapter 6: Object-Oriented Programming

fuzzy
fuzzy_immutable
fuzzy_mutable
fuzzy_value
shaper1
shaper2
shaper3
ordered_map
qtrac.eu/omap
font
shaper_ans1
shaper_ans2
shaper_ans3

Chapter 7: Concurrent Programming

filter
cgrep1
cgrep2
cgrep3
safemap
apachereport1
apachereport2
apachereport3
findduplicates
safeslice
apachereport4
[apachereport5 added to examples after publication; see errata]
imagetag1
imagetag2
sizeimages1
sizeimages2

Chapter 8: File Handling

invoicedata
pack
unpack
unpack_ans
utf16-to-utf8
invoicedata_ans

Chapter 9: Packages

qtrac.eu/omap
cgrep3
linkcheck

Jump to

Keyboard shortcuts

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