Improve error message
This commit is contained in:
parent
a86f2db2dc
commit
127a601fb7
5
main.go
5
main.go
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue