Skip to content

Commit

Permalink
ignore not found error for token file
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoh86 committed May 4, 2021
1 parent a5e376d commit 5f62b10
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/hub/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ func NewFile(file string) (TokenManager, error) {
func readFile(file string) (map[string]string, error) {
fp, err := os.Open(file)
if err != nil {
if os.IsNotExist(err) {
return map[string]string{}, nil
}
return nil, err
}
defer fp.Close()
Expand Down

0 comments on commit 5f62b10

Please sign in to comment.