Skip to content

Commit

Permalink
cleanup: error message
Browse files Browse the repository at this point in the history
  • Loading branch information
donuts-kontoshihito committed May 21, 2024
1 parent bc9a77d commit 1334655
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/go-subst/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func main() {
c := &gosubst.CLI{}
if err := c.Run(); err != nil {
fmt.Fprintf(os.Stderr, "command failed: %s", err)
fmt.Fprintf(os.Stderr, "error: %s", err)
os.Exit(1)
}
}
8 changes: 4 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (c *CLI) prepare() error {
func (c *CLI) process() error {
result, err := goconfig.ReadWithEnvBytes(c.input)
if err != nil {
return fmt.Errorf("goconfig.ReadWithEnvBytes failed: %w", err)
return fmt.Errorf("goconfig.ReadWithEnvBytes: %w", err)
}

c.result = result
Expand All @@ -54,10 +54,10 @@ func (c *CLI) process() error {

func (c *CLI) flush() error {
if _, err := c.output.Write(c.result); err != nil {
return fmt.Errorf("Write failed: %w", err)
return fmt.Errorf("output.Write: %w", err)
}
if err := c.output.Flush(); err != nil {
return fmt.Errorf("Flush failed: %w", err)
return fmt.Errorf("output.Flush: %w", err)
}
return nil
}
Expand All @@ -82,7 +82,7 @@ func (c *CLI) scanStdin() error {
}

if err := scanner.Err(); err != nil {
return fmt.Errorf("scanner.Scan failed: %w", err)
return fmt.Errorf("scanner.Scan: %w", err)
}

return nil
Expand Down

0 comments on commit 1334655

Please sign in to comment.