embed struct inside func

This commit is contained in:
Kirill Zhuravlev 2023-02-15 18:08:13 +01:00 committed by Avelino
parent 07df6adfbc
commit 1e6ba5dd3e
No known key found for this signature in database
GPG Key ID: B345B4D52E98180A
1 changed files with 4 additions and 5 deletions

View File

@ -59,10 +59,6 @@ type issue struct {
Body string `json:"body"`
}
type repo struct {
Archived bool `json:"archived"`
}
func (t *tokenSource) Token() (*oauth2.Token, error) {
return &oauth2.Token{
AccessToken: t.AccessToken,
@ -179,7 +175,10 @@ func testRepoState(toRun bool, href string, client *http.Client, staleRepos *[]s
defer resp.Body.Close()
var repoResp repo
var repoResp struct {
Archived bool `json:"archived"`
}
if err := json.NewDecoder(resp.Body).Decode(&repoResp); err != nil {
return false
}