Refactor pprof.go to use switch instead of if/else

Hello, I think using a switch statement in this case makes the code look cleaner / idiomatic.