The bookshop's gift card codes all start with a capital GIFT-. Write IsGiftCode(code) to return true for a gift card code and false otherwise. The starter already trims the spaces at both ends; case matters, so gift-1 doesn't count.
IsGiftCode("GIFT-2024")→TrueIsGiftCode(" GIFT-77 ")→TrueIsGiftCode("SALE-5")→Falsefunc IsGiftCode(code string) boolpackage main
import "strings"
func IsGiftCode(code string) bool {
code = strings.TrimSpace(code)
// your code here: return whether code starts with "GIFT-"
return false
}
Run tries the examples. When they look right, Submit.