Skip to content

Instantly share code, notes, and snippets.

@onewland
Created July 29, 2012 20:31
Show Gist options
  • Save onewland/3201682 to your computer and use it in GitHub Desktop.
Save onewland/3201682 to your computer and use it in GitHub Desktop.
redis.go with flag.Parse fix
// lines 529-on
// ----------------------------------------------------------------------------
// package initiatization and internal ops and flags
// ----------------------------------------------------------------------------
// ----------------
// flags
//
// go-redis will make use of command line flags where available. flag names
// for this package are all prefixed by "redis:" to prevent possible name collisions.
//
func init() {
runtime.GOMAXPROCS(2);
flagset := flag.NewFlagSet("debug-only", flag.ContinueOnError)
flagset.Usage = func(){};
// redis:d
//
// global debug flag for redis package components.
//
// TEMP: should default to false
_debug = flagset.Bool("redis:d", false, "debug flag for go-redis")
flagset.Parse(os.Args[1:]);
}
var _debug *bool // attached to redis:d flag
func debug() bool {
return *_debug
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment