Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
4d677ee3
Commit
4d677ee3
authored
Nov 15, 2023
by
Michael Yang
Browse files
no divide by zero
parent
7ea90587
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
progress/bar.go
progress/bar.go
+6
-1
No files found.
progress/bar.go
View file @
4d677ee3
...
...
@@ -105,7 +105,12 @@ func (b *Bar) percent() float64 {
}
func
(
b
*
Bar
)
rate
()
float64
{
return
(
float64
(
b
.
currentValue
)
-
float64
(
b
.
initialValue
))
/
b
.
elapsed
()
.
Seconds
()
elapsed
:=
b
.
elapsed
()
if
elapsed
.
Seconds
()
>
0
{
return
(
float64
(
b
.
currentValue
)
-
float64
(
b
.
initialValue
))
/
elapsed
.
Seconds
()
}
return
0
}
func
(
b
*
Bar
)
elapsed
()
time
.
Duration
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment