diff --git a/.golangci.yml b/.golangci.yml index 824c997..6ceb3f9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,6 +15,7 @@ linters-settings: - github.com/DimVlas/otus_hw/hw09_struct_validator/rules - github.com/stretchr/testify/require - github.com/stretchr/testify/assert + - github.com/mailru/easyjson - $gostd exhaustive: explicit-exhaustive-switch: true diff --git a/hw10_program_optimization/stats.go b/hw10_program_optimization/stats.go index 014c7d2..860ae80 100644 --- a/hw10_program_optimization/stats.go +++ b/hw10_program_optimization/stats.go @@ -2,6 +2,7 @@ package hw10programoptimization import ( "bufio" + "errors" "io" "strings" @@ -33,10 +34,9 @@ func domainsStat(r io.Reader, domain string) (DomainStat, error) { for { line, err := rd.ReadBytes('\n') if err != nil { - switch err { - case io.EOF: + if !errors.Is(err, io.EOF) { br = true - default: + } else { return nil, err } }