From 18b2f511cb08d8f093b7043f7a714f61c0bfba54 Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Fri, 15 Jul 2016 18:15:07 -0400 Subject: [PATCH] Use pointer receiver for all of Host --- host.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/host.go b/host.go index 4505dc1..5e887f9 100644 --- a/host.go +++ b/host.go @@ -77,7 +77,7 @@ func (h *Host) SetMotd(motd string) { h.mu.Unlock() } -func (h Host) isOp(conn sshd.Connection) bool { +func (h *Host) isOp(conn sshd.Connection) bool { key := conn.PublicKey() if key == nil { return false @@ -185,7 +185,7 @@ func (h *Host) Serve() { } } -func (h Host) completeName(partial string) string { +func (h *Host) completeName(partial string) string { names := h.NamesPrefix(partial) if len(names) == 0 { // Didn't find anything @@ -195,7 +195,7 @@ func (h Host) completeName(partial string) string { return names[len(names)-1] } -func (h Host) completeCommand(partial string) string { +func (h *Host) completeCommand(partial string) string { for cmd, _ := range h.commands { if strings.HasPrefix(cmd, partial) { return cmd