Before this you need to prepare required files customers.csv
, email_template.json
- Install required packages
go mod download
- Build the binary
go build -o main .
- Run the binary
# ./main ${EMAIL_TEMPLATE_PATH} ${CUSTOMER_PATH} ${OUTPUT_DIR} ${ERROR_PATH}
# Example
./main assets/email_template.json \
assets/customers.csv \
output error/errors.csv
- Build the image
docker build -t go-mailer .
- Run the container
docker run --name go-mailer \
--rm --privileged \
-v /$(pwd)/assets:/assets:ro \
-v /$(pwd)/error:/error \
-v /$(pwd)/output:/output \
go-mailer \
assets/email_template.json \
assets/customers.csv output \
error/errors.csv
go test ./...
Or you can run the test with VSCode Testing