go-irc / irc

A simple go irc library meant to be a building block for other projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove duped fields in irc.Event

belak opened this issue · comments

Currently irc.Event has a number of duplicated fields.

Event.Prefix is the same as Event.Identity.Raw. You can even infer the Event.Prefix from Event.Identity.

I would like to remove Event.Identity and replace it with Event.SplitPrefix() (nick, user, host string)

Any comments, or ideas on how to make this better? This does have the unfortunate side effect of possibly requiring the parsing of Event.Prefix multiple times, though I don't think that should be a huge issue.

Just wanted to note that this is in preparation for adding stringers to the Event struct. In its current state, that would be fairly annoying as there is not a single source of truth for the prefix. This would move that source of truth into Event.Prefix

This will be fixed when pr #10 goes in