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

Side by Side Diff: appengine/logdog/coordinator/endpoints/util.go

Issue 1971493003: LogDog: Project READ access for user endpoints. (Closed) Base URL: https://github.com/luci/luci-go@logdog-project-service-config
Patch Set: Updated patchset dependency Created 4 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
OLDNEW
(Empty)
1 // Copyright 2016 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 endpoints
6
7 import (
8 "time"
9
10 "github.com/luci/luci-go/common/proto/google"
11 )
12
13 // MinDuration selects the smallest duration that is > 0 from a set of
14 // google.Duration protobufs.
15 //
16 // If none of the supplied Durations are > 0, 0 will be returned.
17 func MinDuration(candidates ...*google.Duration) (exp time.Duration) {
nodir 2016/05/19 17:17:21 I like that you called it Min. It is more concrete
dnj (Google) 2016/05/19 20:10:46 Agreed.
18 for _, c := range candidates {
19 if cd := c.Duration(); cd > 0 && (exp <= 0 || cd < exp) {
20 exp = cd
21 }
22 }
23 return
24 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698