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:
parent
a4d51b5586
commit
566670cc06
36 changed files with 369 additions and 376 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue