Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: go/src/infra/tools/cipd/clock.go

Issue 1129043003: cipd: Refactor client to make it more readable. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « go/src/infra/tools/cipd/client_test.go ('k') | go/src/infra/tools/cipd/clock_test.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 package cipd
6
7 import "time"
8
9 // clock is a global mockable clock instance.
10 var clock clockInterface = &realClock{}
11
12 type clockInterface interface {
13 Now() time.Time
14 Sleep(time.Duration)
15 }
16
17 type realClock struct{}
18
19 func (c *realClock) Now() time.Time { return time.Now() }
20 func (c *realClock) Sleep(d time.Duration) { time.Sleep(d) }
OLDNEW
« no previous file with comments | « go/src/infra/tools/cipd/client_test.go ('k') | go/src/infra/tools/cipd/clock_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698