Skip to content

Instantly share code, notes, and snippets.

View danwakefield's full-sized avatar
🤠
Probably breaking something.

Daniel Wakefield danwakefield

🤠
Probably breaking something.
View GitHub Profile
@danwakefield
danwakefield / fnmatch.go
Created March 27, 2016 20:53 — forked from lilyball/fnmatch.go
fnmatch implementation for Go
// Provide string-matching based on fnmatch.3
package fnmatch
// There are a few issues that I believe to be bugs, but this implementation is
// based as closely as possible on BSD fnmatch. These bugs are present in the
// source of BSD fnmatch, and so are replicated here. The issues are as follows:
//
// * FNM_PERIOD is no longer observed after the first * in a pattern
// This only applies to matches done with FNM_PATHNAME as well
// * FNM_PERIOD doesn't apply to ranges. According to the documentation,
@danwakefield
danwakefield / main.go
Last active August 29, 2015 14:18 — forked from creack/main.go
package main
import (
"crypto/rand"
"flag"
"fmt"
"io"
"log"
"net"
"os"