Skip to content

Commit

Permalink
adding links to the code on all the chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
quii committed Apr 27, 2018
1 parent dbbe868 commit 100ca40
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Property based tests \(todo\)
### Standard lib essentials

* [HTTP server WIP](http-server.md) - Learn how to TDD a web server
* JSON
* `io`
* JSON marhshalling
* `time`
* Sorting

Expand Down
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
## Standard lib essentials

- [HTTP server (WIP)](http-server.md)
- [JSON (todo)](#)
- [`io` (todo)](#)
- [JSON marhshalling (todo)](#)
- [`time` (todo)](#)
- [Sorting (todo)](#)

Expand Down
2 changes: 2 additions & 0 deletions arrays-and-slices.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Arrays and slices

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/arrays)**

Arrays allow you to store multiple elements of the same type in a variable in
a particular order.

Expand Down
2 changes: 2 additions & 0 deletions concurrency.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Concurrency

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/concurrency)**

Here's the setup: a colleague has written a function, `CheckWebsites`, that
checks the status of a list of URLs.

Expand Down
2 changes: 2 additions & 0 deletions dependency-injection.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Dependency Injection

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/di)**

It is assumed that you have read the structs section before as some understanding of interfaces will be needed for this.

There is _a lot_ of misunderstandings around dependency injection around the programming community. Hopefully this guide will show you how
Expand Down
2 changes: 2 additions & 0 deletions hello-world.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Hello, World

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/hello-world)**

It is traditional for your first program in a new language to be Hello, world. Create a file called `hello.go` and write this code. To run it type `go run hello.go`.

```go
Expand Down
2 changes: 2 additions & 0 deletions integers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Integers

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/integers)**

Integers work as you would expect. Let's write an add function to try things out. Create a test file called `adder_test.go` and write this code.

## Write the test first
Expand Down
2 changes: 2 additions & 0 deletions iteration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Iteration

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/for)**

To do stuff repeatedly in Go, you'll need `for`. In go there are no `while`, `do`, `until` keywords, you can only use `for`. Which is a good thing!

Let's write a test for a function that repeats a character 5 times.
Expand Down
2 changes: 2 additions & 0 deletions mocking.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Mocking

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/mocking)**

You have been asked to write a program which counts from 3, printing each number on a new line (with a 1 second pause) and when it reaches zero it will print "Go!" and exit.

```
Expand Down
2 changes: 2 additions & 0 deletions pointers-and-errors.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Pointers & errors

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/pointers)**

We learned about structs in the last section which let us capture a number of values related around a concept.

At some point you may wish to use structs to manage state, exposing methods to let users change the state in a way that you can control.
Expand Down
2 changes: 2 additions & 0 deletions select.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Select

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/select)**

You have been asked to make a function called `WebsiteRacer` which takes two URLs and "races" them by hitting them with a HTTP GET and returning the URL which returned first. If none of them return within 10 seconds then it should return an `error`

For this we will be using
Expand Down
2 changes: 2 additions & 0 deletions structs-methods-and-interfaces.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Structs, methods & interfaces

**[You can find all the code for this chapter here](https://github.com/quii/learn-go-with-tests/tree/master/structs)**

Suppose that we need some geometry code to calculate the perimeter of a rectangle given a height and width. We can write a `Perimeter(width float64, height float64)` function, where `float64` is for floating-point numbers like `123.45`

The TDD cycle should be pretty familiar to you by now.
Expand Down

0 comments on commit 100ca40

Please sign in to comment.