- Notifications
You must be signed in to change notification settings - Fork2
Example showing how to test exec.Command in Go
License
NotificationsYou must be signed in to change notification settings
jthomperoo/test-exec-command-golang
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Accompanies this article:Unit-Testing-Exec-Command-In-Golang
Packagefunshell contains theShellCommand function which is being tested.ShellCommand just kicks off the shell commandecho 'fun!'.
Themain function inmain.go just calls this, catches errors and then prints out anything that was output to stdout.
Packagefunshell_test runs some simple unit tests againstShellCommand.
Run the program withgo run main.go.
Run the tests withgo test ./...
About
Example showing how to test exec.Command in Go
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.