mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Remove the MonotonicTime.Nanoseconds() accessor.
Updates #7338. PiperOrigin-RevId: 448360987
This commit is contained in:
@@ -103,7 +103,7 @@ func Example() {
|
||||
panic(fmt.Sprintf("table.GetLastUsedTimestamp(%#v) = (_, false)", routeKey))
|
||||
}
|
||||
|
||||
fmt.Printf("Last used timestamp: %d", timestamp.Nanoseconds())
|
||||
fmt.Printf("Last used timestamp: %s", timestamp)
|
||||
|
||||
// Finally, to remove an installed route, call:
|
||||
if removed := table.RemoveInstalledRoute(routeKey); !removed {
|
||||
|
||||
@@ -452,8 +452,8 @@ func TestSetLastUsedTimestamp(t *testing.T) {
|
||||
t.Fatalf("got table.GetLastUsedTimestamp(%#v) = (_, false_), want = (_, true)", defaultRouteKey)
|
||||
}
|
||||
|
||||
if got, want := timestamp.Nanoseconds(), test.wantLastUsedTime.Nanoseconds(); got != want {
|
||||
t.Errorf("got table.GetLastUsedTimestamp(%#v) = (%v, _), want (%v, _)", defaultRouteKey, got, want)
|
||||
if timestamp != test.wantLastUsedTime {
|
||||
t.Errorf("got table.GetLastUsedTimestamp(%#v) = (%s, _), want = (%s, _)", defaultRouteKey, timestamp, test.wantLastUsedTime)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+3
-3
@@ -71,9 +71,9 @@ type MonotonicTime struct {
|
||||
nanoseconds int64
|
||||
}
|
||||
|
||||
// Nanoseconds returns the monotonic time in nanoseconds.
|
||||
func (mt MonotonicTime) Nanoseconds() int64 {
|
||||
return mt.nanoseconds
|
||||
// String implements Stringer.
|
||||
func (mt MonotonicTime) String() string {
|
||||
return strconv.FormatInt(mt.nanoseconds, 10)
|
||||
}
|
||||
|
||||
// Before reports whether the monotonic clock reading mt is before u.
|
||||
|
||||
Reference in New Issue
Block a user