Fixed credentials.go for use in main.go, and implemented generate