diff options
author | 2018-12-08 06:15:11 -0800 | |
---|---|---|
committer | 2018-12-08 06:15:11 -0800 | |
commit | 0f7d95b1e7466512c1bee194d3601d4852a966e9 (patch) | |
tree | 249cf390c007c92ebd37cc9f5edbbc6acfd2cf77 | |
parent | f02da83e9cdf6956c72e452c6b9a287fb5c84e18 (diff) | |
download | coredns-0f7d95b1e7466512c1bee194d3601d4852a966e9.tar.gz coredns-0f7d95b1e7466512c1bee194d3601d4852a966e9.tar.zst coredns-0f7d95b1e7466512c1bee194d3601d4852a966e9.zip |
Convert bool map to struct{} map in etcd.go (#2381)
This fix converts bool map to struct{} map in etcd.go
(there might be several other places).
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
-rw-r--r-- | plugin/etcd/etcd.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/etcd/etcd.go b/plugin/etcd/etcd.go index 5d258507c..9b37ee458 100644 --- a/plugin/etcd/etcd.go +++ b/plugin/etcd/etcd.go @@ -118,7 +118,7 @@ func (e *Etcd) get(path string, recursive bool) (*etcdcv3.GetResponse, error) { } func (e *Etcd) loopNodes(kv []*mvccpb.KeyValue, nameParts []string, star bool) (sx []msg.Service, err error) { - bx := make(map[msg.Service]bool) + bx := make(map[msg.Service]struct{}) Nodes: for _, n := range kv { if star { @@ -145,7 +145,7 @@ Nodes: if _, ok := bx[b]; ok { continue } - bx[b] = true + bx[b] = struct{}{} serv.Key = string(n.Key) serv.TTL = e.TTL(n, serv) |