Nervous about submitting a paper - what if I made a mistake? I'm an undergraduate and I've taken part in a summer internship. Part of the internship was writing a paper based on a model we developed, which we're hoping to submit.

The paper is "finished" now, and so we're ready to send it off for peer review. I'm really nervous about this as while I've checked over the code time and time again there's always the chance I'll have made a mistake somewhere which might not get picked up on.

How do people cope with this? If there is a mistake that I haven't identified, and isn't picked up in peer review, how damaging will it be if someone else identifies it later on? I'm kind of nervous given what I've heard about retractions and breaches of ethics. 

To the best of my knowledge the model is working, and to my knowledge the results it is generating are correct.
(Upon @Massimo Ortolano's kind suggestion:)

Your issue is not even about "retractions", much less "breach of ethics", if you (and all your co-authors, and advisors/mentors) are acting in good faith. "Making a mistake even with due diligence" cannot be a punishable offense, or no one at all risk-averse would ever do any new work/research/etc. In other words, it's not like a school course where there is some "ultimate judgement" and "absolute standards". In this regard, many school systems from kindergarten through high school (the U.S. name) through undergrad school (the U.S. name) cultivate terrible reflexes, yes.

That is, even if you did make some sort of serious mistake, it's not like it "goes on your permanent record, and a letter is sent home to your parents, and you'll be 'grounded' for two months". The paper just gets rejected (if the referee detects your supposed error!), and hardly anyone in the world knows about your gaffe... whether or not it is upsetting to you personally. People have to "go out on a limb" (English idiom) to make serious progress, and this oughtn't be punished.