fixing bug - don't use pointer receivers unless necessary

This commit is contained in:
William Dillon 2026-07-23 07:32:24 -04:00
parent cd58fd5e0e
commit 17bf84df04

View File

@ -14,7 +14,7 @@ type Message struct {
ClosesChannel bool ClosesChannel bool
} }
func (m *Message) Clone() Message { func (m Message) Clone() Message {
results := Message{ results := Message{
Dialect: strings.Clone(m.Dialect), Dialect: strings.Clone(m.Dialect),
ID: strings.Clone(m.ID), ID: strings.Clone(m.ID),
@ -66,13 +66,13 @@ func ByteIsSpace(b byte) bool {
// Lines that are not encapsulated in XML tags or // Lines that are not encapsulated in XML tags or
// are not recognized as part of a known dialect // are not recognized as part of a known dialect
// are called chatter. // are called chatter.
func (m *Message) Chatter() bool { func (m Message) Chatter() bool {
return len(m.Dialect) == 0 && len(m.ID) == 0 && len(m.Parameters) == 0 return len(m.Dialect) == 0 && len(m.ID) == 0 && len(m.Parameters) == 0
} }
// Lines that have no associated ChannelID are // Lines that have no associated ChannelID are
// called anonymous messages. // called anonymous messages.
func (m *Message) Anonymous() bool { func (m Message) Anonymous() bool {
return !m.Chatter() && len(m.ID) == 0 return !m.Chatter() && len(m.ID) == 0
} }