Skip to content

Commit

Permalink
debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
cpunion committed Nov 21, 2024
1 parent 136ace9 commit 401c360
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/internal/create/templates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ import (
func main() {
Initialize()
defer Finalize()
println("Hello, World!")

Check warning on line 10 in cmd/internal/create/templates/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/internal/create/templates/main.go#L10

Added line #L10 was not covered by tests
}
5 changes: 2 additions & 3 deletions cmd/internal/rungo/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,12 @@ func RunCommand(command string, args []string) error {
cmd.Env = append(goEnv, os.Environ()...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if command == "run" {
cmd.Stdin = os.Stdin
}
cmd.Stdin = os.Stdin

Check warning on line 122 in cmd/internal/rungo/run.go

View check run for this annotation

Codecov / codecov/patch

cmd/internal/rungo/run.go#L122

Added line #L122 was not covered by tests

// Execute the command
if err := cmd.Run(); err != nil {
if exitErr, ok := err.(*exec.ExitError); ok {
fmt.Fprintf(os.Stderr, "Command exited with code %d, stderr: %s\n", exitErr.ExitCode(), string(exitErr.Stderr))

Check warning on line 127 in cmd/internal/rungo/run.go

View check run for this annotation

Codecov / codecov/patch

cmd/internal/rungo/run.go#L127

Added line #L127 was not covered by tests
os.Exit(exitErr.ExitCode())
}
return fmt.Errorf("error executing command: %v", err)
Expand Down

0 comments on commit 401c360

Please sign in to comment.