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 // 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. // possibility to manually step time or to virtually jump to a specified time.
type TestClock struct{ type TestClock struct {
clock test clock test
} }

View File

@ -1,10 +1,10 @@
package times_test package times_test
import ( import (
"testing"
"code.squareroundforest.org/arpio/times" "code.squareroundforest.org/arpio/times"
"time"
"sort" "sort"
"testing"
"time"
) )
func TestSys(t *testing.T) { func TestSys(t *testing.T) {
@ -212,7 +212,7 @@ func TestTest(t *testing.T) {
var a []<-chan time.Time var a []<-chan time.Time
for _, d := range initOrder { 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] }) 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" import "time"
type sys struct {} type sys struct{}
func (sys) Now() time.Time { func (sys) Now() time.Time {
return time.Now() return time.Now()

View File

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