mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-12 10:32:27 -06:00
One side effect of the way that Go's flag library works is that any flag that's defined at the global scope by any library that's built into your binary shows up in your help -- whether you honor it or not. Arguably, including the library and calling its entry points should be tantamount to honoring the flags. This change makes the profiling flags behave that way -- there's one function that you call to turn on whichever kinds of profiling the user specifies on the command line. It returns an object with a Stop() method that you call to shut down profiling and flush data, like so: defer profile.MaybeStartProfile().Stop()