Skip to content

Commit 03d508d

Browse files
committed
fix: update code
Signed-off-by: yihong0618 <[email protected]>
1 parent af20931 commit 03d508d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

github.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"flag"
66
"fmt"
7-
"io/ioutil"
87
"math/rand"
98
"os"
109
"path"
@@ -33,7 +32,6 @@ var (
3332
)
3433

3534
var baseURL = "https://github.com/"
36-
var myTitle = "# My GitHub Status\n"
3735
var myCreatedTitle = "## The repos I created\n"
3836
var myContributedTitle = "## The repos I contributed to\n"
3937

@@ -241,7 +239,7 @@ func makePrRepos(issues []*github.Issue, client *github.Client) ([]myPrInfo, int
241239
}
242240
repoCache[repoKey] = repo
243241
}
244-
if *repo.Private == true {
242+
if *repo.Private {
245243
continue
246244
}
247245
if len(prMap[repoName]) == 0 {
@@ -449,7 +447,7 @@ func main() {
449447
myPrString := makeContributedString(myPRs, totalPrCount)
450448

451449
readMeFile := path.Join(os.Getenv("GITHUB_WORKSPACE"), "README.md")
452-
readMeContent, err := ioutil.ReadFile(readMeFile)
450+
readMeContent, err := os.ReadFile(readMeFile)
453451
if err != nil {
454452
panic(err)
455453
}
@@ -459,7 +457,7 @@ func main() {
459457
newContentString = newContentString + myStaredString
460458
}
461459
newContent := []byte(re.ReplaceAllString(string(readMeContent), `$1`+"\n"+newContentString+`$3`))
462-
err = ioutil.WriteFile(readMeFile, newContent, 0644)
460+
err = os.WriteFile(readMeFile, newContent, 0644)
463461
if err != nil {
464462
panic(err)
465463
}

0 commit comments

Comments
 (0)