Commit dec17313 authored by Stephen Heywood's avatar Stephen Heywood

Update Chapter 1 code links to listings as per book

parent 41734844
......@@ -104,12 +104,12 @@ https://docs.nextcloud.com/server/13/user_manual/files/access_webdav.html
*** 1.2. Noteworthy aspects of Go
**** 1.2.1. Multiple return values
[[file:go-in-practice/chapter1/returns.go][chapter1/returns.go]]
[[file:go-in-practice/chapter1/returns2.go][chapter1/returns2.go]]
[[file:go-in-practice/chapter1/returns.go][Listing 1.1 Multiple returns: returns.go]]
[[file:go-in-practice/chapter1/returns2.go][Listing 1.2 Named return values: returns2.go]]
***** Direct Linking to code
You can open these and type ~, x x~ to run =spacemacs/go-run-main=
[[file:go-in-practice/chapter1/returns.go][chapter1/returns.go]]
[[file:go-in-practice/chapter1/returns.go][Listing 1.1 Multiple returns: returns.go]]
***** INCLUDING the src
~, '~ to open this included file in a dedicated buffer.
......@@ -141,7 +141,7 @@ Foo
- The "underscore" character ~_~ is used to tell the compiler that "I don't care about this variable or it's content"
**** 1.2.2. A modern standard library
[[file:go-in-practice/chapter1/read_status.go][chapter1/read_status.go]]
[[file:go-in-practice/chapter1/read_status.go][Listing 1.3 Read TCP status: read_status.go]]
#+INCLUDE: "./go-in-practice/chapter1/read_status.go" src go
#+NAME: Listing 13 Read TCP status: read_status.go
......@@ -191,7 +191,7 @@ Go - encoding is UTF-8 internally
- function ~count()~ is run in parallel using the keyword ~go~, e.g. ~go count()~
- This causes main to continue executing immediately without needing the count() function to finish first.
[[file:go-in-practice/chapter1/goroutine.go][chapter1/goroutine.go]]
[[file:go-in-practice/chapter1/goroutine.go][Listing 1.6 Printing concurrently: goroutine.go]]
#+INCLUDE: "./go-in-practice/chapter1/goroutine.go" src go
#+NAME: Listing 1.6 Printing concurrently
......@@ -225,7 +225,7 @@ Hello World
- Channels provide a way for two goroutines to communicate with each other.
- Channels can be one-directional or bidirectional
[[file:go-in-practice/chapter1/channel.go][chapter1/channel.go]]
[[file:go-in-practice/chapter1/channel.go][Listing 1.7 Using channels: channel.go]]
#+INCLUDE: "./go-in-practice/chapter1/channel.go" src go
#+NAME: Listing 1.7 Using channels: channel.go
......@@ -306,7 +306,7 @@ func main() {
- TODO Explore gocheck / go-use-gocheck-for-testing
https://github.com/syl20bnr/spacemacs/tree/master/layers/%2Blang/go#tests
[[file:go-in-practice/chapter1/hello/hello.go][chapter1/hello/hello.go]]
[[file:go-in-practice/chapter1/hello/hello.go][Listing 1.10 Hello World: hello.go]]
#+INCLUDE: "./go-in-practice/chapter1/hello/hello.go" src go
#+NAME: Listing 1.10 Hello World: hello.go
......@@ -328,7 +328,7 @@ Hello World!
To test, open this file and run ~, t t~
[[file:go-in-practice/chapter1/hello/hello_test.go::/getName(/][chapter1/hello/hello_test.go]]
[[file:go-in-practice/chapter1/hello/hello_test.go::/getName(/][Listing 1.11 Hello World test: hello_test.go]]
#+INCLUDE: "./go-in-practice/chapter1/hello/hello_test.go" src go
#+NAME: Listing 1.12 Running go test manually
......@@ -485,7 +485,7 @@ Use "go help <topic>" for more information about that topic.
- Create a web server
[[file:go-in-practice/chapter1/inigo.go][chapter1/hello/inigo.go]]
[[file:go-in-practice/chapter1/inigo.go][Listing 1.16 Hello World web server: inigo.go]]
#+INCLUDE: "./go-in-practice/chapter1/inigo.go" src go
#+NAME: Listing 1.16 Hello World web server: inigo.go
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment