mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-18 17:57:41 +03:00
Use pointer receiver for all of Host
This commit is contained in:
parent
9bf1f53445
commit
18b2f511cb
6
host.go
6
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user