Commit Graph
9 Commits
Author SHA1 Message Date
Alexander Bruyako 688014487b avoid "index out of range" error
in case of len(format) == 0, we will get an
"index out of range" error
Usage of strings.HasSuffix is allowing to avoid that
2020-01-27 19:24:42 +03:00
Alexander Bruyako 38ddfbc4d3 simpler error return 2020-01-27 18:41:46 +03:00
Alexander Bruyako da48b925ff remove unnecessary error return
I was running "golangci-lint" and found this two warnings

internal/checker/checker.go:135:18: (*Checker).LoadIndex$3 - result 0 (error) is always nil (unparam)
        final := func() error {
                        ^
internal/repository/repository.go:457:18: (*Repository).LoadIndex$3 - result 0 (error) is always nil (unparam)
        final := func() error {
                        ^

It turns out that these functions are used only in "RunWorkers(...)",
which is used only two times in whole project right after this "final"
functions.
And because these "final" functions always return "nil", I've
descided, that it would be better to remove requriments for "final" func
to return error to avoid magick "return nil" at their end.
2020-01-27 18:28:21 +03:00
Alexandr Bruyako e19622e4b1 start using fileMode const 2019-07-01 00:26:00 +03:00
Alexandr Bruyako 38ea7ed4f6 remove unused code 2019-07-01 00:24:45 +03:00
Alexandr Bruyako 76d1866444 avoiding unnecessary type conversions 2019-06-30 23:58:00 +03:00
Alexandr Bruyako 8b22fe29cf improved slice copying 2019-06-30 23:56:36 +03:00
Alexandr Bruyako 02014be76c simplified prefix removal, removed unnecessary if-else statements 2019-06-30 23:34:47 +03:00
Alexandr Bruyako 16eeed2ad5 simplified string sorting by using a more suitable function 2019-06-30 23:20:32 +03:00