参考: http://qiita.com/ikawaha/items/e3b35f09fb49e9217924
変更
diff --git a/go-wc.go b/go-wc.go
index 0eac463..554f61f 100644
--- a/go-wc.go
+++ b/go-wc.go
@@ -7,6 +7,7 @@ import (
参考: http://qiita.com/ikawaha/items/e3b35f09fb49e9217924
変更
diff --git a/go-wc.go b/go-wc.go
index 0eac463..554f61f 100644
--- a/go-wc.go
+++ b/go-wc.go
@@ -7,6 +7,7 @@ import (
Mac の wc と比較する
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
type FetchedUrl struct { | |
url map[string]bool | |
mux sync.Mutex |
package main | |
import "golang.org/x/tour/tree" | |
import "fmt" | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
func Walk(t *tree.Tree, ch chan int) { | |
var walker func(t *tree.Tree) | |
walker = func(t *tree.Tree) { |
package main | |
import "golang.org/x/tour/pic" | |
import "image" | |
import "image/color" | |
type Image struct { | |
width int | |
height int | |
} |
package main | |
import ( | |
"io" | |
"os" | |
"strings" | |
) | |
type rot13Reader struct { | |
r io.Reader |
package main | |
import "golang.org/x/tour/reader" | |
type MyReader struct{} | |
// Add a Read([]byte) (int, error) method to MyReader. | |
func (r MyReader) Read(b []byte) (int, error) { | |
b[0] = 'A' | |
return 1, nil |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
type ErrNegativeSqrt float64 | |
func (e ErrNegativeSqrt) Error() string { |
package main | |
import "fmt" | |
import "strings" | |
type IPAddr [4]byte | |
// Add a "String() string" method to IPAddr. | |
func (ipaddr IPAddr) String() string { | |
octets := make([]string, 4) |
package main | |
import "fmt" | |
// fibonacci is a function that returns | |
// a function that returns an int. | |
func fibonacci() func() int { | |
var i int | |
var n [3]int | |
return func() int { |