Created
November 18, 2016 05:32
-
-
Save sohlich/e984a00ddf60fbbfb1cc9612b5577e6e to your computer and use it in GitHub Desktop.
Golang program argument testing
This file contains hidden or 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 TestConfigParse(t *testing.T) { | |
oldArgs := os.Args | |
defer func() { os.Args = oldArgs }() | |
os.Args = []string{"metro", | |
"-host=localhost", | |
"-port=30", | |
"-user=ssh", | |
"-password=sshpass", | |
"-list=lst.csv", | |
"-timeout=25"} | |
host := flag.String("host", "", "Host for SSH") | |
flag.Parse() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment