Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Accompanies this article:Unit-Testing-Exec-Command-In-Golang

Overview

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.

Running

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

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp