Criminal trespass in the second degree.
(1) A person is guilty of criminal trespass in the second degree if he knowingly enters or remains unlawfully in or upon premises of another under circumstances not constituting criminal trespass in the first degree.
(2) Criminal trespass in the second degree is a misdemeanor.
In any prosecution under RCW 9A.52.070 and 9A.52.080, it is a defense that:
(1) A building involved in an offense under RCW 9A.52.070 was abandoned; or
(2) The premises were at the time open to members of the public and the actor complied with all lawful conditions imposed on access to or remaining in the premises; or
(3) The actor reasonably believed that the owner of the premises, or other person empowered to license access thereto, would have licensed him to enter or remain; or
(4) The actor was attempting to serve legal process which includes any document required or allowed to be served upon persons or property, by any statute, rule, ordinance, regulation, or court order, excluding delivery by the mails of the United States. This defense applies only if the actor did not enter into a private residence or other building not open to the public and the entry onto the premises was reasonable and necessary for service of the legal process.
Since you knowingly entered the premisis, and know that costco prohibits firearms, it was be an easy argument that you are guilty of Criminal Trespass in the Second Degree. None of the listed exceptions apply.