// sendMessage sends msgs to SQS. func sendMessage(svc *sqs.SQS, msgs ...string) error { // create message send params sendParams := sqs.SendMessageInput{ QueueUrl: queueURL, } // send message for i, msg := range msgs { // message body is a datetime string sendParams.MessageBody = aws.String(msg) _, err := svc.SendMessage(&sendParams) if err != nil { return err } fmt.Printf("message sent %v: %v\n", i, msg) } return nil }
func sendMessage(sqsInstance *sqs.SQS, queueURL *string, message string) error { _, err := sqsInstance.SendMessage(&sqs.SendMessageInput{ QueueURL: queueURL, MessageBody: &message, }) return err }