In a metaphor, there is no like or as. A simile though, is the quite opposite because it uses like or as.
The stars were diamonds in the cold dark sky, does not have like or as and it's saying that the stars are diamonds in the sky but if were to have a "like" in the phrase, then it would be a simile.
My source is my mind!
I hope this helps you!