aboutsummaryrefslogtreecommitdiff
path: root/client/add-entry
diff options
context:
space:
mode:
authorRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-03 10:22:57 +0100
committerRasmus Dahlberg <rasmus.dahlberg@kau.se>2020-11-03 10:22:57 +0100
commit1132536be92df9833ccaa72683eaa7e74e10b9e3 (patch)
treeb0a2f02226b12ef053e44a2f84ba9fc37200948c /client/add-entry
parentc210c80e80231143f6eaa0f39e8e1d3303983791 (diff)
fixed FindLog such that it uses a list of operators
Diffstat (limited to 'client/add-entry')
-rw-r--r--client/add-entry/main.go14
1 files changed, 3 insertions, 11 deletions
diff --git a/client/add-entry/main.go b/client/add-entry/main.go
index 693aca8..e782b09 100644
--- a/client/add-entry/main.go
+++ b/client/add-entry/main.go
@@ -89,17 +89,9 @@ func setup() (*client.Client, error) {
return nil, fmt.Errorf("failed decoding log identifier: %v", err)
}
- // TODO: define FindLog() for []Operator
- var log *descriptor.Log
- for _, op := range ops {
- l, err := op.FindLog(id)
- if err == nil {
- log = l
- break
- }
- }
- if log == nil {
- return nil, fmt.Errorf("unknown log identifier: %v", err)
+ log, err := descriptor.FindLog(ops, id)
+ if err != nil {
+ return nil, err
}
return client.NewClient(log, &http.Client{}, c, &k), nil
}