Browse Source

Set MemProfileRate after flags have been parsed

(doh)
Ask Bjørn Hansen 12 years ago
parent
commit
ab5c7a6959
1 changed files with 4 additions and 4 deletions
  1. 4 4
      geodns.go

+ 4 - 4
geodns.go

@@ -62,10 +62,6 @@ func init() {
 		VERSION = VERSION + "/" + gitVersion
 	}
 
-	if *memprofile != "" {
-		runtime.MemProfileRate = 1024
-	}
-
 	log.SetPrefix("geodns ")
 	log.SetFlags(log.Lmicroseconds | log.Lshortfile)
 }
@@ -73,6 +69,10 @@ func init() {
 func main() {
 	flag.Parse()
 
+	if *memprofile != "" {
+		runtime.MemProfileRate = 1024
+	}
+
 	if *flagShowVersion {
 		fmt.Println("geodns", VERSION, buildTime)
 		os.Exit(0)