Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1b2faea

Browse files
committed
Update: go1.12
1 parent e8cfc26 commit 1b2faea

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

‎.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: go
22

33
go:
4-
- "1.11.x"
4+
- "1.12.x"
55

66
before_install:
77
- go get -t -v ./...

‎internal/leetcode/base.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"net/http"
88
"net/url"
99
"os"
10-
"os/user"
1110
"path"
1211
"strings"
1312
"time"
@@ -56,11 +55,10 @@ func getCsrfToken(cookies []*http.Cookie) string {
5655
}
5756

5857
func getCachePath(f string) string {
59-
dir, err := os.UserCacheDir()
60-
checkErr(err)
61-
u, err := user.Current()
62-
if err == nil && u.HomeDir != "" {
63-
dir = u.HomeDir
58+
dir, err := os.UserHomeDir()
59+
if err != nil {
60+
dir, err = os.UserCacheDir()
61+
checkErr(err)
6462
}
6563
return path.Join(dir, ".leetcode", f)
6664
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /