I hereby claim:
- I am djherbis on github.
- I am djherbis (https://keybase.io/djherbis) on keybase.
#!/bin/bash | |
set -e | |
GVERSION="1.9" | |
GFILE="go$GVERSION.linux-amd64.tar.gz" | |
GOPATH="/mnt/d/Dropbox/Go" | |
GOROOT="/usr/local/go" | |
if [ -d $GOROOT ]; then | |
echo "Installation directories already exist $GOROOT" |
I hereby claim:
package main | |
import ( | |
"bytes" | |
"fmt" | |
"regexp" | |
) | |
func main() { | |
var valid = regexp.MustCompile(Not("abcd")) |
Looks like you have to use gob to register the types you want to stow when
using stow.NewStore
.
Compare original example using stow.NewJsonStore
.
See this post for context.
import ( | |
"io" | |
"log" | |
"net/http" | |
"github.com/djherbis/fscache" | |
) | |
// This will only get called on a cache-miss | |
func Handler(w http.Response, r *http.Request) { |
var mu sync.Mutex | |
var cache map[string][]byte | |
func Handler(w http.Response, r *http.Request) { | |
mu.Lock() | |
defer mu.Unlock() | |
url := r.URL.String() | |
p, ok := cache[url] |
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/boltdb/bolt" | |
"github.com/djherbis/stow" | |
) |