Skip to content

Instantly share code, notes, and snippets.

@Sil1g
Created May 17, 2018 09:29
Show Gist options
  • Save Sil1g/667a6d4533765909fbff308f61818a7c to your computer and use it in GitHub Desktop.
Save Sil1g/667a6d4533765909fbff308f61818a7c to your computer and use it in GitHub Desktop.
todoIrc
func (c *Client) Leave(channels ...string) {
for _, channel := range channels {
go c.send(fmt.Sprintf("PART #%s", channel)) //prob worst way
}
}
func (c *Client) Leave(channels ...string) {
var channelListString string
for _, channel := range channels {
channelListString += fmt.Sprintf("#%s ", channel) //seems good but 5 lines
}
go c.send(fmt.Sprintf("PART %s", channelListString))
}
func (c *Client) Leave(channelListString string) {
go c.send(fmt.Sprintf("PART %s", channelListString)) //bad func argument format
}
@Sil1g
Copy link
Author

Sil1g commented May 17, 2018

Idk if strings.Builder is the right choice tho because it's go1.10+ only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment