Skip to content
Snippets Groups Projects
Unverified Commit 4581b019 authored by deepsource-autofix[bot]'s avatar deepsource-autofix[bot] Committed by GitHub
Browse files

Autofix issues in 2 files

Resolved issues in the following files via DeepSource Autofix:
1. internal/endpoints/consent/pkg/capability.go
2. internal/utils/logger/smartlogger.go
parent 72ecd0e0
No related branches found
No related tags found
No related merge requests found
......@@ -96,9 +96,7 @@ func searchCapability(name string, searchParent bool) *WebCapability {
return searchCapabilityS(allWebCapabilities, name, searchParent)
}
func searchCapabilityS(slice []*WebCapability, name string, searchParent bool) *WebCapability {
if strings.HasPrefix(name, api.CapabilityReadOnlyPrefix) {
name = name[len(api.CapabilityReadOnlyPrefix):]
}
name = strings.TrimPrefix(name, api.CapabilityReadOnlyPrefix)
for _, c := range slice {
if !searchParent && c.ReadWriteCapability.Name == name {
return c
......
......@@ -28,7 +28,7 @@ type rootHook struct {
error *errorHook
}
func (h *rootHook) Levels() []log.Level {
func (*rootHook) Levels() []log.Level {
return log.AllLevels
}
func (h *rootHook) Fire(e *log.Entry) error {
......@@ -51,7 +51,7 @@ type errorHook struct {
file io.Writer
}
func (h *errorHook) Levels() []log.Level {
func (*errorHook) Levels() []log.Level {
return log.AllLevels // we must be triggered at
}
func (h *errorHook) Fire(e *log.Entry) (err error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment