mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
[chore] Fix lint errors (#3218)
* [chore] Fix lint errors under analyzer package * Fix lint error in source manager test * Use Sprint instead of Sprintf where appropriate
This commit is contained in:
parent
c381e901cc
commit
3db9ed7c74
3 changed files with 10 additions and 10 deletions
|
@ -550,12 +550,12 @@ func printOrgs(tokenJSON HFTokenJSON) {
|
|||
enterprise := ""
|
||||
role := ""
|
||||
if org.IsEnterprise {
|
||||
enterprise = color.New(color.FgGreen).Sprintf("True")
|
||||
enterprise = color.New(color.FgGreen).Sprint("True")
|
||||
} else {
|
||||
enterprise = "False"
|
||||
}
|
||||
if org.Role == "admin" {
|
||||
role = color.New(color.FgGreen).Sprintf("Admin")
|
||||
role = color.New(color.FgGreen).Sprint("Admin")
|
||||
} else {
|
||||
role = org.Role
|
||||
}
|
||||
|
@ -641,18 +641,18 @@ func printModelsTable(models []Model) {
|
|||
for _, model := range models {
|
||||
var name, read, write, private string
|
||||
if model.Permissions.Read {
|
||||
read = color.New(color.FgGreen).Sprintf("True")
|
||||
read = color.New(color.FgGreen).Sprint("True")
|
||||
} else {
|
||||
read = "False"
|
||||
}
|
||||
if model.Permissions.Write {
|
||||
write = color.New(color.FgGreen).Sprintf("True")
|
||||
write = color.New(color.FgGreen).Sprint("True")
|
||||
} else {
|
||||
write = "False"
|
||||
}
|
||||
if model.Private {
|
||||
private = color.New(color.FgGreen).Sprintf("True")
|
||||
name = color.New(color.FgGreen).Sprintf(model.Name)
|
||||
private = color.New(color.FgGreen).Sprint("True")
|
||||
name = color.New(color.FgGreen).Sprint(model.Name)
|
||||
} else {
|
||||
private = "False"
|
||||
name = model.Name
|
||||
|
|
|
@ -157,13 +157,13 @@ func AnalyzePermissions(cfg *config.Config, key string) (*AnalyzerJSON, error) {
|
|||
|
||||
meJSON, err := getUserData(cfg, key)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(err.Error())
|
||||
return nil, err
|
||||
}
|
||||
data.me = meJSON
|
||||
|
||||
isAdmin, err := checkAdminKey(cfg, key)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf(err.Error())
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if isAdmin {
|
||||
|
@ -171,7 +171,7 @@ func AnalyzePermissions(cfg *config.Config, key string) (*AnalyzerJSON, error) {
|
|||
} else {
|
||||
data.isRestricted = true
|
||||
if err := analyzeScopes(key); err != nil {
|
||||
return nil, fmt.Errorf(err.Error())
|
||||
return nil, err
|
||||
}
|
||||
data.perms = getPermissions()
|
||||
}
|
||||
|
|
|
@ -207,7 +207,7 @@ func (c *unitChunker) ChunkUnit(ctx context.Context, unit SourceUnit, rep ChunkR
|
|||
continue
|
||||
}
|
||||
if step.err != "" {
|
||||
if err := rep.ChunkErr(ctx, fmt.Errorf(step.err)); err != nil {
|
||||
if err := rep.ChunkErr(ctx, fmt.Errorf("%s", step.err)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue