Skip to content

Commit

Permalink
std(time): fix add duration function with updating nano seconds too
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelVallenet committed Dec 30, 2024
1 parent b856c78 commit 487ed42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gnovm/stdlibs/time/time.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "errors"
//
// Programs using times should typically store and pass them as values,
// not pointers. That is, time variables and struct fields should be of
// type time.Time.
// type time.Time, not *time.Time.
//
// A Time value can be used by multiple goroutines simultaneously except
// that the methods GobDecode, UnmarshalBinary, UnmarshalJSON and
Expand Down Expand Up @@ -620,6 +620,7 @@ func (t Time) Add(d Duration) Time {
nsec += 1e9
}
t.addSec(dsec)
t.nsec = nsec
return t
}

Expand Down

0 comments on commit 487ed42

Please sign in to comment.