Skip to content

Commit 1935ea5

Browse files
authored
updates (#129)
Signed-off-by: Brian Downs <[email protected]>
1 parent 7415b9d commit 1935ea5

File tree

7 files changed

+48
-9
lines changed

7 files changed

+48
-9
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ arch:
33
- ppc64le
44
language: go
55
go:
6-
- 1.13
7-
- 1.14.1
6+
- 1.16
7+
- 1.17.5
88
env:
99
- GOARCH: amd64
1010
- GOARCH: 386

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
GO = GO111MODULE=on GOFLAGS=-mod=vendor go
1+
GO = go
22

33
.PHONY: deps
4-
deps:
5-
$(GO) mod download
6-
$(GO) mod vendor
4+
deps: go.mod
5+
6+
go.mod:
7+
go mod init
8+
go mod tidy
79

810
.PHONY: test
911
test:

NOTICE.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Spinner
2+
Copyright (c) 2021 Brian J. Downs
3+
This product is licensed to you under the Apache 2.0 license (the "License"). You may not use this product except in compliance with the Apache 2.0 License.
4+
This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file.

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ go get github.com/briandowns/spinner
1515
```
1616

1717
## Available Character Sets
18+
19+
90 Character Sets. Some examples below:
20+
1821
(Numbered by their slice index)
1922

2023
| index | character set | sample gif |
@@ -151,15 +154,15 @@ You can specify both the background and foreground color, as well as additional
151154
s.Color("red", "bold") // Set the spinner color to a bold red
152155
```
153156

154-
Or to set the background to black, the foreground to a bold red:
157+
To set the background to black, the foreground to a bold red:
155158

156159
```Go
157160
s.Color("bgBlack", "bold", "fgRed")
158161
```
159162

160163
Below is the full color and attribute list:
161164

162-
```
165+
```Go
163166
// default colors
164167
red
165168
black

character_sets.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
// Copyright (c) 2021 Brian J. Downs
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
115
package spinner
216

317
const (
@@ -25,6 +39,7 @@ var CharSets = map[int][]string{
2539
15: {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"},
2640
16: {"▉", "▊", "▋", "▌", "▍", "▎", "▏", "▎", "▍", "▌", "▋", "▊", "▉"},
2741
17: {"■", "□", "▪", "▫"},
42+
2843
18: {"←", "↑", "→", "↓"},
2944
19: {"╫", "╪"},
3045
20: {"⇐", "⇖", "⇑", "⇗", "⇒", "⇘", "⇓", "⇙"},
@@ -86,6 +101,16 @@ var CharSets = map[int][]string{
86101
78: {"⠈⠁", "⠈⠑", "⠈⠱", "⠈⡱", "⢀⡱", "⢄⡱", "⢄⡱", "⢆⡱", "⢎⡱", "⢎⡰", "⢎⡠", "⢎⡀", "⢎⠁", "⠎⠁", "⠊⠁"},
87102
79: {"________", "-_______", "_-______", "__-_____", "___-____", "____-___", "_____-__", "______-_", "_______-", "________", "_______-", "______-_", "_____-__", "____-___", "___-____", "__-_____", "_-______", "-_______", "________"},
88103
80: {"|_______", "_/______", "__-_____", "___\\____", "____|___", "_____/__", "______-_", "_______\\", "_______|", "______\\_", "_____-__", "____/___", "___|____", "__\\_____", "_-______"},
104+
81: {"□", "◱", "◧", "▣", "■"},
105+
82: {"□", "◱", "▨", "▩", "■"},
106+
83: {"░", "▒", "▓", "█"},
107+
84: {"░", "█"},
108+
85: {"⚪", "⚫"},
109+
86: {"◯", "⬤"},
110+
87: {"▱", "▰"},
111+
88: {"➊", "➋", "➌", "➍", "➎", "➏", "➐", "➑", "➒", "➓"},
112+
89: {"½", "⅓", "⅔", "¼", "¾", "⅛", "⅜", "⅝", "⅞"},
113+
90: {"↞", "↟", "↠", "↡"},
89114
}
90115

91116
func init() {

spinner.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright (c) 2021 Brian J. Downs
2+
//
13
// Licensed under the Apache License, Version 2.0 (the "License");
24
// you may not use this file except in compliance with the License.
35
// You may obtain a copy of the License at
@@ -171,7 +173,7 @@ func validColor(c string) bool {
171173

172174
// Spinner struct to hold the provided options.
173175
type Spinner struct {
174-
mu *sync.RWMutex //
176+
mu *sync.RWMutex
175177
Delay time.Duration // Delay is the speed of the indicator
176178
chars []string // chars holds the chosen character set
177179
Prefix string // Prefix is the text preppended to the indicator
@@ -202,6 +204,7 @@ func New(cs []string, d time.Duration, options ...Option) *Spinner {
202204
for _, option := range options {
203205
option(s)
204206
}
207+
205208
return s
206209
}
207210

spinner_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright (c) 2021 Brian J. Downs
2+
//
13
// Licensed under the Apache License, Version 2.0 (the "License");
24
// you may not use this file except in compliance with the License.
35
// You may obtain a copy of the License at

0 commit comments

Comments
 (0)