gogits/gogs — pull request #272 by nuss-justin (2014-07-04 09:56:26+00:00)
Title: Add 'pprof' tag for enabling debugging

Hi,

having looked at gogs the last few days I often profiled parts of it, but because writing the code to add profiling to gogs is (at the moment) something everybody has to do himself/herself each time he/she wants to profile something I want to share this little bit of code with you.

It adds a new build tag 'pprof' which enables pprof profiling under the default /debug/pprof path of the [golang.org/pkg/net/http/pprof/](net/http/pprof) package and disallows the name "debug" for users.

To enable it one just has to build gogs like this `go build -tags pprof`.

If something is wrong or must be changed, I'm happy to update my code.