When, upon the trial of any proceeding under this chapter, it appears from the evidence that the defendant has been guilty of either a forcible entry or a forcible or unlawful detainer, and other than the offense charged in the complaint, the judge must order that such complaint be forthwith amended to conform to such proofs. Such amendment must be without any imposition of terms. No continuance shall be permitted upon account of such amendment unless the defendant, by affidavit filed, shows to the satisfaction of the court good cause therefor.
Idaho Code § 6-315