Nervous about submitting a paper - what if I made a mistake?
(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.
First, congratulation on your first manuscript! The peer review process assesses several aspects of submitted manuscripts. It's hard for a paper to be denied on the basis of a few minor mistakes. Usually, you get comments from peer reviewers asking for minor modifications, corrections and explanations.
Even the best manuscripts go through multiple steps of submitting and resubmitting after editing as per peer reviewers annotations.
Minor mistaks in code, if they exist, shouldn't be cause to refuse a manuscript.
Good luck again!
"What if there's a big mistake?" Well, it's detected, everyone becomes a little wiser and more knowledgeable, and life goes on.
If you've never seen it before, check out the case of BICEP2. On 17 March 2014, this large international collaboration claimed to have found something very important. Press conferences were called, people were excited, the popular media such as the New York Times got involved. And then they found out the signal was contaminated. Oops. Life goes on.
So don't worry about it. There're a lot of wrong papers out there. If your paper turns out to be wrong - and it's not certain at all it will - there's likely to be no permanent damage to your career. After all, you'd be in good company.