• Hana (Hyang-Ah) Kim's avatar
    cmd/pprof: add readline support similar to upstream · 3f892149
    Hana (Hyang-Ah) Kim authored
    The upstream pprof implements the readline feature using
    the github.com/chzyer/readline package in its pprof.go main.
    
    It would be ideal to use the same readline support package as
    the upstream for better user experience and code maintenance.
    However, bringing in third-party packages requires more work
    than I envisioned (e.g. clean up the vendored code to meet the
    expected standard - iow don't break builders).
    
    As a result, this change implements the similar feature
    for the pprof command included in the go distribution
    (cmd/pprof/pprof.go) using golang.org/x/crypto/ssh/terminal
    for now.
    
    Auto-completion is not yet supported (same in the upstream).
    
    The feature is enabled only in linux, windows, darwin, and
    only when terminal support is available.
    
    This change brings in new vendored packages,
    golang.org/x/crypto/ssh/terminal and
    golang.org/x/sys/{unix,windows}.
    
    For #14041
    
    Change-Id: If4a790796acf2ab20f7e81268b9d9354c5a5cd2b
    Reviewed-on: https://go-review.googlesource.com/112436
    Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    3f892149
race.go 607 Bytes