5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-22 20:00:27 +00:00

Update admin.go

Replace `nil` with `[]string{}` for `list`'s argument list.
This commit is contained in:
Arceliar 2018-11-26 19:15:27 -06:00 committed by GitHub
parent 5912dcc72c
commit b3e2b8e6a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,7 +52,7 @@ func (a *admin) addHandler(name string, args []string, handler func(admin_info)
func (a *admin) init(c *Core, listenaddr string) { func (a *admin) init(c *Core, listenaddr string) {
a.core = c a.core = c
a.listenaddr = listenaddr a.listenaddr = listenaddr
a.addHandler("list", nil, func(in admin_info) (admin_info, error) { a.addHandler("list", []string{}, func(in admin_info) (admin_info, error) {
handlers := make(map[string]interface{}) handlers := make(map[string]interface{})
for _, handler := range a.handlers { for _, handler := range a.handlers {
handlers[handler.name] = admin_info{"fields": handler.args} handlers[handler.name] = admin_info{"fields": handler.args}