This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
) | |
func main() { | |
filepath.Walk("/tmp/", func(path string, info os.FileInfo, err error) error { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package eg | |
func foo() string { | |
return "foo" | |
} | |
func Bar() string { | |
return "Bar" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package stringbuild_test | |
import ( | |
"bytes" | |
"testing" | |
) | |
func StringBuild_bad() string { | |
str := "" | |
for i := 0; i < 1000; i++ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/golang/glog" | |
) | |
func foo() { | |
glog.Info("info v1") | |
glog.Error("error v1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
fmt.Println("hello") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"path/filepath" | |
) | |
func main() { | |
matches, err := filepath.Glob("*/*.go") | |
if err != nil { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd `go env GOROOT`/src | |
echo "hg pull";hg pull | |
if [ "$?" -eq 0 ] | |
then | |
echo "OK" | |
#echo "hg update weekly";hg update weekly | |
echo "hg update release";hg update release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// You can define a version string using -ldflags and -X options. | |
// $ go run -ldflags "-X main.version 0.1" version.go | |
// | |
package main | |
import ( | |
"fmt" | |
) | |
var version string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## for OSX | |
## You can call Emacs on the terminal and use environment variables of your shell. | |
open -a Emacs --args $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example | |
import ( | |
"fmt" | |
"reflect" | |
) | |
func ExamplePanic() { | |
err := Counter("hoge") |
OlderNewer