Created
October 3, 2012 17:50
-
-
Save pmn/3828571 to your computer and use it in GitHub Desktop.
Second Scanf getting skipped?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func getConnectionInfo() string { | |
// Prompt the user for connection string info | |
var servername, username, password string | |
fmt.Print("Enter Server Name:") | |
fmt.Scanf("%s", &servername) | |
fmt.Print("Enter User Name:") | |
fmt.Scanf("%s", &username) | |
fmt.Print("Enter Password:") | |
fmt.Scanf("%s", &password) | |
connstr := "Server=" + servername + ";user id=" + username + ";password=" + password | |
return connstr | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment