1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-31 18:31:01 +00:00

refactor: unexport symbols

This commit is contained in:
Julien Voisin 2025-08-08 02:27:04 +02:00 committed by GitHub
parent a4d51b5586
commit 566670cc06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 369 additions and 376 deletions

View file

@ -10,20 +10,20 @@ import (
"strings"
)
var ErrInvalidDurationFormat = errors.New("rss: invalid duration format")
var errInvalidDurationFormat = errors.New("rss: invalid duration format")
func getDurationInMinutes(rawDuration string) (int, error) {
var sumSeconds int
durationParts := strings.Split(rawDuration, ":")
if len(durationParts) > 3 {
return 0, ErrInvalidDurationFormat
return 0, errInvalidDurationFormat
}
for i, durationPart := range durationParts {
durationPartValue, err := strconv.Atoi(durationPart)
if err != nil {
return 0, ErrInvalidDurationFormat
return 0, errInvalidDurationFormat
}
sumSeconds += int(math.Pow(60, float64(len(durationParts)-i-1))) * durationPartValue