Improve error message

This commit is contained in:
Moto Ishizawa 2020-02-01 20:18:16 +09:00
parent a86f2db2dc
commit 127a601fb7
1 changed files with 2 additions and 3 deletions

View File

@ -18,8 +18,8 @@ package main
import ( import (
"context" "context"
"errors"
"flag" "flag"
"fmt"
"os" "os"
"github.com/google/go-github/v29/github" "github.com/google/go-github/v29/github"
@ -56,8 +56,7 @@ func main() {
ghToken := os.Getenv("GITHUB_TOKEN") ghToken := os.Getenv("GITHUB_TOKEN")
if ghToken == "" { if ghToken == "" {
err := errors.New("github token is not specified") fmt.Fprintln(os.Stderr, "Error: access token is not specified in the environment variable 'GITHUB_TOKEN'")
setupLog.Error(err, "environment variable 'GITHUB_TOKEN' must be set")
os.Exit(1) os.Exit(1)
} }