Created
July 29, 2012 20:31
-
-
Save onewland/3201682 to your computer and use it in GitHub Desktop.
redis.go with flag.Parse fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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