Stating the obvious, the protagonist is about to be executed, and is saying his "goodnight" to all. McPherson's Lament would be a good example, as are the ones you gave.