The bug is very simple:
if worksheet.MergeCells is not nil and xw.Write(mergeCells) executed, code returned incorrectly.
So, the logic of worksheet.DataValidations won't be executed even it's not nil.
👇 Click on the image for a new way to code review
####
[![Review these changes using an interactive CodeSee Map](https://s3.us-east-2.amazonaws.com/maps.codesee.io/images/github/tealeg/xlsx/785/bc7ad3e0/b3d7083b7ab336e688ba147aa85ec393d7bb5a3e.svg)](https://app.codesee.io/r/reviews?pr=785&src=https%3A%2F%2Fgithub.com%2Ftealeg%2Fxlsx)
#### Legend
The bug is very simple: if
worksheet.MergeCells
is not nil andxw.Write(mergeCells)
executed, code returned incorrectly. So, the logic ofworksheet.DataValidations
won't be executed even it's not nil.