Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

Similar to os/exec but without waiting for child process

License

NotificationsYou must be signed in to change notification settings

MrMarble/exec

Repository files navigation

Go ReferenceGo Report CardTests

Theexec package in Go is designed to run external commands. It is similar to theos/exec package, but provides a simpler interface and does not support streaming.

Main Features

  • The main difference betweenexec andos/exec is that the process does not wait for child processes to finish. This is useful for running long-running processes that are expected to run in the background.

Example

out,err:=exec.Command("date").Output()iferr!=nil {log.Fatal(err)}fmt.Printf("The date is %s\n",out)

This example runs thedate command and logs any errors that occur.


[8]ページ先頭

©2009-2025 Movatter.jp