1
0

code formatting

This commit is contained in:
Arpad Ryszka 2026-03-04 21:22:35 +01:00
parent 1589e358cf
commit c05f718ebf
4 changed files with 9 additions and 9 deletions

2
lib.go
View File

@ -16,7 +16,7 @@ type Clock interface {
// TestClock is a test implementation of the Clock interface. On top of the Clock methods, it adds the
// possibility to manually step time or to virtually jump to a specified time.
type TestClock struct{
type TestClock struct {
clock test
}

View File

@ -1,10 +1,10 @@
package times_test
import (
"testing"
"code.squareroundforest.org/arpio/times"
"time"
"sort"
"testing"
"time"
)
func TestSys(t *testing.T) {
@ -212,7 +212,7 @@ func TestTest(t *testing.T) {
var a []<-chan time.Time
for _, d := range initOrder {
a = append(a, c.After(d * time.Millisecond))
a = append(a, c.After(d*time.Millisecond))
}
sort.Slice(a, func(i, j int) bool { return initOrder[i] < initOrder[j] })

2
sys.go
View File

@ -2,7 +2,7 @@ package times
import "time"
type sys struct {}
type sys struct{}
func (sys) Now() time.Time {
return time.Now()

View File

@ -1,13 +1,13 @@
package times
import (
"time"
"sort"
"time"
)
type clockState struct {
current time.Time
chans map[time.Time][]chan<- time.Time
current time.Time
chans map[time.Time][]chan<- time.Time
chantlist []time.Time
}
@ -19,7 +19,7 @@ func makeTestClock(initial time.Time) test {
s := make(chan clockState, 1)
s <- clockState{
current: initial,
chans: make(map[time.Time][]chan<- time.Time),
chans: make(map[time.Time][]chan<- time.Time),
}
return test{state: s}