Skip to content
This repository was archived by the owner on May 11, 2025. It is now read-only.

Commit c0bf995

Browse files
committed
update api
1 parent 4ead61f commit c0bf995

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

api.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,21 @@ func GetLanguages(username string, repo string) (data map[string]interface{}, er
2121
err = Get(fmt.Sprintf("repos/%s/%s/languages", username, repo), &data)
2222
return data, err
2323
}
24+
25+
func GetUserExist(username string) bool {
26+
res, err := GetUser(username)
27+
if err != nil {
28+
return false
29+
}
30+
val, ok := res["message"]
31+
return !(ok && val == "Not Found")
32+
}
33+
34+
func GetRepoExist(username string, repo string) bool {
35+
res, err := GetRepo(username, repo)
36+
if err != nil {
37+
return false
38+
}
39+
val, ok := res["message"]
40+
return !(ok && val == "Not Found")
41+
}

0 commit comments

Comments
 (0)