We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Message Tagger

Textio needs a way to tag messages based on specific criteria.

Assignment

See the tip below on how the strings package could be used here.

Regardless of casing just means that even "uRGent" or "SALE" should trigger the tag.

Example usage:

messages := []sms{
	{id: "001", content: "Urgent! Last chance to see!"},
	{id: "002", content: "Big sale on all items!"},
	// Additional messages...
}
taggedMessages := tagMessages(messages, tagger)
// `taggedMessages` will now have tags based on the content.
// 001 = [Urgent]
// 002 = [Promo]

Tip

The go strings package, specifically the Contains and ToLower functions, can be very helpful here!