Skip to content

Instantly share code, notes, and snippets.

View kaneshin's full-sized avatar
🏠
Working from home

Shintaro Kaneko kaneshin

🏠
Working from home
View GitHub Profile
package main
import (
"bytes"
"fmt"
"os/exec"
)
func main() {
cmd := exec.Command("ls", "-lf")
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
package main
import (
"log"
"net/http"
)
func pingHandler() func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
package main
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
)
package main
import (
"log"
"net/http"
)
func EchoHandler(msg string) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/plain")
var (
canPostSomeoneTypingMessage = func() func() bool {
enable := true
return func() bool {
if !enable {
return false
}
go func() {
package app
import (
"net/http"
"github.com/kaneshin/gae-handson/app"
)
func init() {
http.Handle("/", app.Router)
@kaneshin
kaneshin / main.go
Last active October 18, 2016 11:22
package main
import (
"log"
"net/http"
"github.com/kaneshin/gae-handson/app"
)
func main() {