RosettaCodeData/Task/Write-to-Windows-event-log/Go/write-to-windows-event-log.go
2019-09-12 10:33:56 -07:00

17 lines
341 B
Go

package main
import (
"fmt"
"os/exec"
)
func main() {
command := "EventCreate"
args := []string{"/T", "INFORMATION", "/ID", "123", "/L", "APPLICATION",
"/SO", "Go", "/D", "\"Rosetta Code Example\""}
cmd := exec.Command(command, args...)
err := cmd.Run()
if err != nil {
fmt.Println(err)
}
}