Created
May 17, 2018 09:29
-
-
Save Sil1g/667a6d4533765909fbff308f61818a7c to your computer and use it in GitHub Desktop.
todoIrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Idk if strings.Builder is the right choice tho because it's go1.10+ only