If the application terminates for a panic that is not recovered, then the deferred function will be executed, but the exit code will be 2:
package main
import (
"fmt"
)
func main() {
defer fmt.Println("Hello, playground")
panic("panic")
}
The full example is available at https://play.golang.org/p/mjOMb0KsM3e.