Skip to content

Commit 75024c3

Browse files
authored
Replace clock.Default() with clock.New() (letsencrypt#4761)
clock.Default is deprecated: https://godoc.org/github.com/jmhodges/clock#Default
1 parent b567adb commit 75024c3

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

akamai/cache-client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ func NewCachePurgeClient(
119119
retries: retries,
120120
retryBackoff: retryBackoff,
121121
log: log,
122-
clk: clock.Default(),
122+
clk: clock.New(),
123123
purgeLatency: purgeLatency,
124124
purges: purges,
125125
}, nil

cmd/cert-checker/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ func BenchmarkCheckCert(b *testing.B) {
5353
test.ResetSATestDatabase(b)()
5454
}()
5555

56-
checker := newChecker(saDbMap, clock.Default(), pa, expectedValidityPeriod)
56+
checker := newChecker(saDbMap, clock.New(), pa, expectedValidityPeriod)
5757
testKey, _ := rsa.GenerateKey(rand.Reader, 1024)
5858
expiry := time.Now().AddDate(0, 0, 1)
5959
serial := big.NewInt(1337)

cmd/clock_generic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ package cmd
44

55
import "github.com/jmhodges/clock"
66

7-
// Clock functions similarly to clock.Default(), but the returned value can be
7+
// Clock functions similarly to clock.New(), but the returned value can be
88
// changed using the FAKECLOCK environment variable if the 'integration' build
99
// flag is set.
1010
//
1111
// This function returns the default Clock.
1212
func Clock() clock.Clock {
13-
return clock.Default()
13+
return clock.New()
1414
}

log/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func New(log *syslog.Writer, stdoutLogLevel int, syslogLogLevel int) (Logger, er
6060
return nil, errors.New("Attempted to use a nil System Logger.")
6161
}
6262
return &impl{
63-
&bothWriter{log, stdoutLogLevel, syslogLogLevel, clock.Default()},
63+
&bothWriter{log, stdoutLogLevel, syslogLogLevel, clock.New()},
6464
}, nil
6565
}
6666

mail/mailer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func New(
141141
},
142142
log: logger,
143143
from: from,
144-
clk: clock.Default(),
144+
clk: clock.New(),
145145
csprgSource: realSource{},
146146
reconnectBase: reconnectBase,
147147
reconnectMax: reconnectMax,
@@ -155,7 +155,7 @@ func NewDryRun(from mail.Address, logger blog.Logger) *MailerImpl {
155155
return &MailerImpl{
156156
dialer: dryRunClient{logger},
157157
from: from,
158-
clk: clock.Default(),
158+
clk: clock.New(),
159159
csprgSource: realSource{},
160160
sendMailAttempts: prometheus.NewCounterVec(prometheus.CounterOpts{
161161
Name: "send_mail_attempts",

va/dns_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func TestDNSValidationNoServer(t *testing.T) {
157157
time.Second*5,
158158
nil,
159159
metrics.NoopRegisterer,
160-
clock.Default(),
160+
clock.New(),
161161
1,
162162
log)
163163

va/va_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ func setup(
204204
userAgent,
205205
"letsencrypt.org",
206206
metrics.NoopRegisterer,
207-
clock.Default(),
207+
clock.New(),
208208
logger,
209209
accountURIPrefixes,
210210
"")

0 commit comments

Comments
 (0)