Skip to content

Instantly share code, notes, and snippets.

View me7's full-sized avatar

Gampol T. me7

  • Thailand
View GitHub Profile
@me7
me7 / DirWalk.go
Created April 23, 2015 02:56
walk directory and read file content to array of strings
package main
import (
"fmt"
"path/filepath"
"os"
"io/ioutil"
"strings"
)
@me7
me7 / tipgodoc
Created April 16, 2015 10:58
tip.golang.org from hacking with andrew and brad
//
//
//
package main
import (
"bufio"
"encoding/json"
"flag"
@me7
me7 / readline.go
Last active August 29, 2015 14:18
Process text file. One line at a time. Python is 45% shorter (19 vs 34 line) but go run 25% faster (1.23 vs 1.70 second on 500,000 line file). But I prefer go because easier distribute (build exe file)
package main
import (
"fmt"
"bufio"
"os"
"regexp"
"strings"
"time"
)