Skip to content

Instantly share code, notes, and snippets.

View VojtechVitek's full-sized avatar
🏄
https://golang.cz

Vojtech Vitek (golang.cz) VojtechVitek

🏄
https://golang.cz
View GitHub Profile
@VojtechVitek
VojtechVitek / rot13_reader.go
Created April 15, 2014 16:50
A Tour of Go - Exercise: Rot13 Reader
package main
import (
"io"
"os"
"strings"
)
type rot13Reader struct {
r io.Reader
@VojtechVitek
VojtechVitek / fibonacci_closure.go
Created April 14, 2014 10:44
A Tour of Go | Exercise: Fibonacci closure
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
fib := 0
return func() int {
first, second := 0, 1