mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2024-11-25 10:46:01 +03:00
acc95923da
* replace media workers with just runners.WorkerPool, move to state structure, use go-sched for global task scheduling * improved code comment * fix worker tryUntil function, update go-runners/go-sched * make preprocess functions package public, use these where possible to stop doubled up processing * remove separate emoji worker pool * limit calls to time.Now() during media preprocessing * use Processor{} to manage singular runtime of processing media * ensure workers get started when media manager is used * improved error setting in processing media, fix media test * port changes from processingmedia to processing emoji * finish code commenting * finish code commenting and comment-out client API + federator worker pools until concurrency worker pools replaced * linterrrrrrrrrrrrrrrr --------- Signed-off-by: kim <grufwub@gmail.com> |
||
---|---|---|
.. | ||
debug.go | ||
debug_env.go | ||
debug_off.go | ||
debug_on.go | ||
LICENSE | ||
pprof_off.go | ||
pprof_on.go | ||
README.md | ||
run_tests.sh |
go-debug
This library provides a very simple method for compile-time or runtime determined debug checks, set using build tags.
The compile-time checks use Go constants, so when disabled your debug code will not be compiled.
The possible build tags are:
-
"debug" || "" = debug determined at compile-time
-
"debugenv" = debug determined at runtime using the $DEBUG environment variable
An example for how this works in practice can be seen by the following code:
func main() {
println("debug.DEBUG() =", debug.DEBUG())
}
# Debug determined at compile-time, it is disabled
$ go run .
debug.DEBUG() = false
# Debug determined at compile-time, it is enabled
$ go run -tags=debug .
debug.DEBUG() = true
# Debug determined at runtime, $DEBUG is not set
$ go run -tags=debugenv .
debug.DEBUG() = false
# Debug determined at runtime, $DEBUG is set
$ DEBUG=y go run -tags=debugenv .
debug.DEBUG() = true