Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: lint fixes #833

Merged
merged 3 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmd/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ var CacheCmd = &cobra.Command{
Short: "For working with the cache the results of an analysis",
Long: `Cache commands allow you to add a remote cache, list the contents of the cache, and remove items from the cache.`,
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
err := cmd.Help()
if err != nil {
panic(err)
}
},
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ func GetCacheConfiguration() (ICache, error) {
cache = &FileBasedCache{}
}

cache.Configure(cacheInfo)
err_config := cache.Configure(cacheInfo)

return cache, nil
return cache, err_config
}

func AddRemoteCache(cacheInfo CacheProvider) error {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cache/s3_based.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ func (s *S3Cache) Load(key string) (string, error) {
}

buf := new(bytes.Buffer)
buf.ReadFrom(result.Body)
_, err_read := buf.ReadFrom(result.Body)
result.Body.Close()
return buf.String(), nil
return buf.String(), err_read
}

func (s *S3Cache) List() ([]CacheObjectDetails, error) {
Expand Down
7 changes: 4 additions & 3 deletions pkg/server/server_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package server

import (
"github.com/fatih/color"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
"os"
"sync"
"testing"

"github.com/fatih/color"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
)

func TestServerInit(t *testing.T) {
Expand Down
5 changes: 4 additions & 1 deletion pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ func SliceDiff(source, dest []string) []string {
func MaskString(input string) string {
key := make([]byte, len(input))
result := make([]rune, len(input))
rand.Read(key)
_, err := rand.Read(key)
if err != nil {
panic(err)
}
for i := range result {
result[i] = anonymizePattern[int(key[i])%len(anonymizePattern)]
}
Expand Down
Loading