code: func startProfile(cpuprofile, memprofile string) {
  	if cpuprofile != "" {
  		f, err := os.Create(cpuprofile)
  		if err != nil {
  			log.Fatalf("failed to create CPU profile file at %s: %s", cpuprofile, err.Error())
  		}
  		log.Printf("writing CPU profile to: %s\n", cpuprofile)
  		prof.cpu = f
  		pprof.StartCPUProfile(prof.cpu)
  	}
  
  	if memprofile != "" {
  		f, err := os.Create(memprofile)
  		if err != nil {
  			log.Fatalf("failed to create memory profile file at %s: %s", cpuprofile, err.Error())
  		}
  		log.Printf("writing memory profile to: %s\n", memprofile)
  		prof.mem = f
  		runtime.MemProfileRate = 4096
  	}
  }
docs: // startProfile initializes the CPU and memory profile, if specified.