Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
Coredns
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
Coredns
Commits
c788649a
Commit
c788649a
authored
Dec 08, 2018
by
Yong Tang
Committed by
corbot[bot]
Dec 08, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace bool map with struct{} map in chaos plugin (#2384)
Automatically submitted.
parent
95546dfd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
plugin/chaos/chaos.go
plugin/chaos/chaos.go
+1
-1
plugin/chaos/chaos_test.go
plugin/chaos/chaos_test.go
+1
-1
plugin/chaos/setup.go
plugin/chaos/setup.go
+3
-3
No files found.
plugin/chaos/chaos.go
View file @
c788649a
...
...
@@ -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.
...
...
plugin/chaos/chaos_test.go
View file @
c788649a
...
...
@@ -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
{
...
...
plugin/chaos/setup.go
View file @
c788649a
...
...
@@ -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
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment