Skip to content

Instantly share code, notes, and snippets.

View gophertron's full-sized avatar
🎯
Focusing

gophertron

🎯
Focusing
View GitHub Profile
@gophertron
gophertron / ping_test.go
Created August 2, 2016 17:54
sample httptest usage
package main
import (
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
)
func TestPingHandler(t *testing.T) {
@gophertron
gophertron / unmarshal.go
Created August 2, 2016 17:52
Unmarshal json to map
package main
import (
"encoding/json"
"fmt"
)
type Any interface{}
func main() {
@gophertron
gophertron / slack_rtm.go
Created July 2, 2016 16:53
slack websocket api example
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"golang.org/x/net/websocket"
@gophertron
gophertron / weboauth.go
Last active November 25, 2023 06:36
github oauth gorilla
package main
import (
"fmt"
"log"
"net/http"
"github.com/codegangsta/negroni"
gh "github.com/google/go-github/github"
"github.com/gorilla/mux"
@gophertron
gophertron / web.go
Created June 29, 2016 14:51
negroni, gorilla and middleware
package main
import (
"fmt"
"log"
"net/http"
"github.com/codegangsta/negroni"
"github.com/gorilla/mux"
)