Use pointer receiver for all of Host
authorAndrey Petrov <andrey.petrov@shazow.net>
Fri, 15 Jul 2016 22:15:07 +0000 (18:15 -0400)
committerAndrey Petrov <andrey.petrov@shazow.net>
Fri, 15 Jul 2016 22:15:07 +0000 (18:15 -0400)
host.go

diff --git a/host.go b/host.go
index 4505dc14a6cd9e2a0749234c99a4ea4e0c27a0da..5e887f96a9cb6f8f77c3dae2e0b1334b4f14460b 100644 (file)
--- 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