Joe Gallagher, who is 42, from Benroe, Bruckless, was arrested by Gardai after a tip-off from staff at Mr Chippy in Letterkenny on February 19 this year.
Inspector David Murphy told Letterkenny District Court that officers were called after staff reported two men behaving suspiciously in the toilets.
When officers searched Gallagher they found heroin with a street value of €30, two spoons and a syringe.
Defence solicitor Rory O’Brien said his client had been a drug user in the past and the incident was a relapse. He had been clean since the incident, he said, and Gallagher was “embarrassed and remorseful.”
Mr O’Brien went on: “He (Gallagher) will say that he was less culpable of the two individuals. The drugs belonged to the other man; he thought he had more or less beaten the drugs – there was a relapse. He says he is not using anymore.”
Judge Paul Kelly adjourned sentencing until March 10 to allow for a probation report.
“I am doing this because there is a difference, it is unlikely this was a once-off considering the drug that was involved,” said the judge.