When two or more persons are charged with an offense in the same information or indictment, the court, at any time before the defendants have gone into their defense, on the application of the state's attorney, may direct any defendant to be discharged from the information or indictment, that that defendant may be a witness for the state.
N.D.C.C. § 29-21-08