Skip to content

Instantly share code, notes, and snippets.

aodin

View GitHub Profile
@aodin
aodin / gist:9493340
Created Mar 11, 2014
Insert to PostGres
View gist:9493340
package main
import (
"database/sql"
"log"
_ "github.com/lib/pq"
)
func connect(driver string, credentials string) *sql.DB {
@aodin
aodin / gist:9493190
Last active Jul 1, 2020
Parsing JSON in a request body with Go
View gist:9493190
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
)
type Message struct {
View IsRemote Benchmark
package repo
import (
"testing"
)
func BenchmarkIsRemote(b *testing.B) {
repos := []Repo{
{Path: "git://github.com/foo/far"},
{Path: "git://github.com/foo/far.git"},
View IsRemoteRegex
package repo
import (
"fmt"
"regexp"
"strings"
)
type Repo struct {
// The path of the Repoisotry. This could be
You can’t perform that action at this time.