Skip to content

Commit 3ef5687

Browse files
committed
avoid nil cmd
1 parent 0d48e8d commit 3ef5687

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/gh/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ func main() {
5252
}
5353

5454
cmd, _, err := rootCmd.Traverse(expandedArgs)
55-
_, skipAuthCheck := cmd.Annotations["skipAuthCheck"]
5655
if err != nil || cmd == rootCmd {
5756
originalArgs := expandedArgs
5857
isShell := false
@@ -94,6 +93,8 @@ func main() {
9493
}
9594
}
9695

96+
_, skipAuthCheck := cmd.Annotations["skipAuthCheck"]
97+
9798
// TODO support other names
9899
ghtoken := os.Getenv("GITHUB_TOKEN")
99100
if ghtoken != "" {

0 commit comments

Comments
 (0)