Skip to content

Commit

Permalink
Merge pull request #4 from MikeMwita/devmike
Browse files Browse the repository at this point in the history
Fix slice out of index error
  • Loading branch information
MikeMwita authored Feb 21, 2024
2 parents ac3dd51 + c89aa84 commit eac0148
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/sms/sms_sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ func (s *SmsSender) SendSMS() (SmsSenderResponse, error) {

smsMessageData := data["SMSMessageData"].(map[string]interface{})
message := smsMessageData["Message"].(string)
cost := strings.Split(message, " ")[len(message)-1]

cost := ""
for _, word := range strings.Split(message, " ") {
cost = word
}
recipientsData := smsMessageData["Recipients"].([]interface{})

for _, recipient := range recipientsData {
Expand Down

0 comments on commit eac0148

Please sign in to comment.