Moses
Genesis 38:8BSB·traditional attribution

Then Judah said to Onan, “Sleep with your brother’s wife. Perform your duty as her brother-in-law and raise up offspring for your brother.”

John Calvin Reformed @genevareformer

8. Go in unto thy brother’s wife. Although no law had hitherto been prescribed concerning brother’s marriages, that the surviving brother should raise up seed to one who was dead; it is, nevertheless, not wonderful that, by the mere instinct of nature, men should have been inclined to this course.

Matthew Henry Presbyterian @wholebiblehenry

Here is, 1. Judah's foolish friendship with a Canaanite-man. He went down from his brethren, and withdrew for a time from their society and his father's family, and got to be intimately acquainted with one Hirah, an Adullamite, Gen 38:1. It is computed that he was now not much above fifteen or sixteen years of age, an easy prey to the tempter.

Commenting on Genesis 38:1-11

John Gill Reformed Baptist @doctorgill

And Onan knew that the seed should not be his,.... Should not be called a son of his, but a son of his brother Er; this is to be understood only of the firstborn; all the rest of the children born afterwards were reckoned the children of the real parent of them; this shows this was a custom in use in those times, and well...