Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit ab8c02c

Browse files
committed
define spin & exclude in function-level
1 parent 5ab5031 commit ab8c02c

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

pkg/requests/resources.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,21 @@ import (
1717

1818
var (
1919
rsrc *resource.Resources
20-
exclude bool
2120
content []byte
2221
errCon error
23-
spin *spinner.Spinner
2422
)
2523

26-
func init() {
27-
spin = spinner.New(spinner.CharSets[11], 90*time.Millisecond, spinner.WithWriter(os.Stderr))
28-
}
29-
3024
// Resources is to getting all available resources
3125
func Resources(options *common.Options) {
3226
rsrc = resource.Get()
3327
getRules(options)
3428
}
3529

3630
func getRules(options *common.Options) {
37-
client := Client()
31+
var spin = spinner.New(spinner.CharSets[11], 90*time.Millisecond, spinner.WithWriter(os.Stderr))
32+
var exclude bool
3833

34+
client := Client()
3935
rules := options.Configs.Rules
4036
excludes := rules.Threat.Excludes
4137
isCached := rules.Cache

0 commit comments

Comments
 (0)