Merge pull request #778 from cli/bump-spinner

Avoid race conditions when interacting with the spinner
This commit is contained in:
Mislav Marohnić 2020-04-13 16:57:03 +02:00 committed by GitHub
commit 609beb5596
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 6 deletions

2
go.mod
View file

@ -4,7 +4,7 @@ go 1.13
require (
github.com/AlecAivazis/survey/v2 v2.0.7
github.com/briandowns/spinner v1.9.0
github.com/briandowns/spinner v1.10.1-0.20200410162419-bf6cf7ae6727
github.com/charmbracelet/glamour v0.1.1-0.20200320173916-301d3bcf3058
github.com/dlclark/regexp2 v1.2.0 // indirect
github.com/google/go-cmp v0.2.0

4
go.sum
View file

@ -20,8 +20,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/briandowns/spinner v1.9.0 h1:+OMAisemaHar1hjuJ3Z2hIvNhQl9Y7GLPWUwwz2Pxo8=
github.com/briandowns/spinner v1.9.0/go.mod h1://Zf9tMcxfRUA36V23M6YGEAv+kECGfvpnLTnb8n4XQ=
github.com/briandowns/spinner v1.10.1-0.20200410162419-bf6cf7ae6727 h1:DOyHtIQZmwFEOt/makVyey2RMTPkpi1IQsWsWX0OcGE=
github.com/briandowns/spinner v1.10.1-0.20200410162419-bf6cf7ae6727/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/charmbracelet/glamour v0.1.1-0.20200320173916-301d3bcf3058 h1:Ks+RZ6s6UriHnL+yusm3OoaLwpV9WPvMV+FXQ6qMD7M=
github.com/charmbracelet/glamour v0.1.1-0.20200320173916-301d3bcf3058/go.mod h1:sC1EP6T+3nFnl5vwf0TYEs1inMigQxZ7n912YKoxJow=

View file

@ -75,7 +75,5 @@ func Humanize(s string) string {
}
func Spinner(w io.Writer) *spinner.Spinner {
s := spinner.New(spinner.CharSets[11], 400*time.Millisecond)
s.Writer = w
return s
return spinner.New(spinner.CharSets[11], 400*time.Millisecond, spinner.WithWriter(w))
}