Apply go fmt and change how to validate code

Go fmt has been applied and Expect now receives two parameters as the previous code was always checking for the first parameter and there was no need to panic