Like a previous poster pointed out, Costco is a membership store and your membership agreement states that you will comply with their cursory examination of your cart as you leave to help them reduce shoplifting and keep their margins thin and their prices down. If you refuse to do so, they can cancel your membership.
This is in contrast to stores that are open to the public (Fry's, Best Buy, etc.). In these situations, you have absolutely no obligation to submit to their search or show them your receipt. None. All the signs in the word about them reserving the right to search your bags are crap. They can't force you to submit to their search as a matter of routine. If they ask "may I see your receipt?" you are fully within your rights to say "no thank you" and walk out the door.
In the absence of any suspicious behaviour on your part that would reasonably cause them to believe you had shoplifted, your refusal to show a receipt or let them look in your bag is not sufficient for them to make any further demands or call the police or anything. This first part is important: in cases where you've acted suspiciously (e.g., a store employee saw you put something in your pocket or purse or you appeared to have swapped price tags on something or whatever), they can ask you to show your receipt or let them look in your bag and if you refuse, they can call the police.
These are important distinctions: membership stores = their rules and you agree in advance by becoming a member. Comply or don't shop there. Public stores = in the absence of probable cause, they have no right to demand to see your receipt or look into your bags. Me, I tell such stores, no thank you and walk out. Only one time have they given me a hassle (Best Buy, I think. Maybe Fry's). In that case, I demanded to see the manager. When he came out, I said "If you believe I have stolen something, state that fact, and I will willingly wait here with you for the police to arrive. If you convince them of your probable cause, I will then submit to their search. Without cause or accusation, I'm not showing you anything. Now, which is it?" The manager apologized and stepped aside.
As an aside, I find the attitude "I have nothing to hide so I don't care if they search me" perhaps one of the most infuriatingly dangerous attitudes that a citizen can have.
Oh, and to the OP, emergencies aside, barging ahead of those in front of you in line without asking is rude. No matter the reason for the line or your opinion of the line's merit.