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

Side by Side Diff: luci_config/server/cfgclient/backend/format/formatters.go

Issue 2963503003: [errors] Greatly simplify common/errors package. (Closed)
Patch Set: fix nits Created 3 years, 5 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
1 // Copyright 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package format 5 package format
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "sync" 9 "sync"
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 registry.r = nil 57 registry.r = nil
58 } 58 }
59 59
60 // getFormatter returns the Formatter associated with the provided Format. 60 // getFormatter returns the Formatter associated with the provided Format.
61 func getFormatter(f string) (Formatter, error) { 61 func getFormatter(f string) (Formatter, error) {
62 registry.RLock() 62 registry.RLock()
63 defer registry.RUnlock() 63 defer registry.RUnlock()
64 64
65 formatter := registry.r[f] 65 formatter := registry.r[f]
66 if formatter == nil { 66 if formatter == nil {
67 » » return nil, errors.Reason("unknown formatter: %(formatter)q").D( "formatter", f).Err() 67 » » return nil, errors.Reason("unknown formatter: %q", f).Err()
68 } 68 }
69 return formatter, nil 69 return formatter, nil
70 } 70 }
OLDNEW
« no previous file with comments | « luci_config/server/cfgclient/backend/format/format.go ('k') | luci_config/server/cfgclient/backend/get_all.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698