It is sort of a mild form of swearing.  Jeez! is short/slang for Jesus! Cripes is short/slang for Christ. Gosh darn it is short/slang for God D**n it. "Gosh is to God as Heck is to Hell." https://www.urbandictionary.com/define.php?term=Gosh