Skip to content

Instantly share code, notes, and snippets.

@danx12
danx12 / exercise-web-crawler.go
Created March 10, 2019 07:48
Exercise: Web Crawler - A Tour of Go
package main
import (
"fmt"
"sync"
)
type Cache struct {
v map[string]int
mux sync.Mutex
@danx12
danx12 / exercise-rot-reader.go
Created March 9, 2019 21:40
Exercise: rot13Reader - A Tour of Go
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
@danx12
danx12 / exercise-equivalent-binary-trees.go
Created March 9, 2019 21:39
Exercise: Equivalent Binary Trees - A Tour of Go
package main
import (
"fmt"
"golang.org/x/tour/tree"
)
func RecursiveWalk(t *tree.Tree, ch chan int) {
if t.Left != nil {
RecursiveWalk(t.Left, ch)