update linter
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
andrey1s
2021-09-19 20:15:01 +03:00
parent 0df834f4ab
commit 4323f5e3b3
12 changed files with 232 additions and 102 deletions

View File

@@ -2,6 +2,7 @@ package level
import (
"encoding/json"
"fmt"
"strings"
)
@@ -28,7 +29,12 @@ const (
)
func (l Level) MarshalJSON() ([]byte, error) {
return json.Marshal(l.String())
b, err := json.Marshal(l.String())
if err != nil {
return nil, fmt.Errorf("marshal err: %w", err)
}
return b, nil
}
func (l Level) Is(level Level) bool {
@@ -42,7 +48,7 @@ func (l Level) Enabled(level Level) bool {
func (l *Level) UnmarshalJSON(in []byte) error {
var v string
if err := json.Unmarshal(in, &v); err != nil {
return err
return fmt.Errorf("unmarshal err: %w", err)
}
lvl := Parse(v)