aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Yong Tang <yong.tang.github@outlook.com> 2018-12-08 15:57:57 -0800
committerGravatar corbot[bot] <corbot[bot]@users.noreply.github.com> 2018-12-08 23:57:57 +0000
commitc788649a0034246fbb325d5f0b66e8eb4d91ed54 (patch)
tree4c527cd61ef7578c64522ca914057d6da500eb57 /plugin
parent95546dfdfeab92149a99734120386ff994bfd639 (diff)
downloadcoredns-c788649a0034246fbb325d5f0b66e8eb4d91ed54.tar.gz
coredns-c788649a0034246fbb325d5f0b66e8eb4d91ed54.tar.zst
coredns-c788649a0034246fbb325d5f0b66e8eb4d91ed54.zip
Replace bool map with struct{} map in chaos plugin (#2384)
Automatically submitted.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/chaos/chaos.go2
-rw-r--r--plugin/chaos/chaos_test.go2
-rw-r--r--plugin/chaos/setup.go6
3 files changed, 5 insertions, 5 deletions
diff --git a/plugin/chaos/chaos.go b/plugin/chaos/chaos.go
index a66c5f003..af76a0bcf 100644
--- a/plugin/chaos/chaos.go
+++ b/plugin/chaos/chaos.go
@@ -16,7 +16,7 @@ import (
type Chaos struct {
Next plugin.Handler
Version string
- Authors map[string]bool
+ Authors map[string]struct{}
}
// ServeDNS implements the plugin.Handler interface.
diff --git a/plugin/chaos/chaos_test.go b/plugin/chaos/chaos_test.go
index bb58c07b4..179aab90c 100644
--- a/plugin/chaos/chaos_test.go
+++ b/plugin/chaos/chaos_test.go
@@ -14,7 +14,7 @@ import (
func TestChaos(t *testing.T) {
em := Chaos{
Version: version,
- Authors: map[string]bool{"Miek Gieben": true},
+ Authors: map[string]struct{}{"Miek Gieben": struct{}{}},
}
tests := []struct {
diff --git a/plugin/chaos/setup.go b/plugin/chaos/setup.go
index 2064f4eae..8028876cf 100644
--- a/plugin/chaos/setup.go
+++ b/plugin/chaos/setup.go
@@ -28,12 +28,12 @@ func setup(c *caddy.Controller) error {
return nil
}
-func chaosParse(c *caddy.Controller) (string, map[string]bool, error) {
+func chaosParse(c *caddy.Controller) (string, map[string]struct{}, error) {
// Set here so we pick up AppName and AppVersion that get set in coremain's init().
chaosVersion = caddy.AppName + "-" + caddy.AppVersion
version := ""
- authors := make(map[string]bool)
+ authors := make(map[string]struct{})
for c.Next() {
args := c.RemainingArgs()
@@ -45,7 +45,7 @@ func chaosParse(c *caddy.Controller) (string, map[string]bool, error) {
}
version = args[0]
for _, a := range args[1:] {
- authors[a] = true
+ authors[a] = struct{}{}
}
return version, authors, nil
}