Skip to content

Commit beb8721

Browse files
authored
dev: use secure links (#5106)
1 parent 00e8a9e commit beb8721

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

docs/.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ coverage
2020
# nyc test coverage
2121
.nyc_output
2222

23-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
23+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
2424
.grunt
2525

2626
# Bower dependency directory (https://bower.io/)
@@ -29,7 +29,7 @@ bower_components
2929
# node-waf configuration
3030
.lock-wscript
3131

32-
# Compiled binary addons (http://nodejs.org/api/addons.html)
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
3333
build/Release
3434

3535
# Dependency directories

pkg/golinters/mnd/testdata/mnd.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ func UseMagicNumber() {
1212
Timeout: 2 * time.Second, // want "Magic number: 2, in <assign> detected"
1313
}
1414

15-
res, err := c.Get("http://www.google.com")
15+
res, err := c.Get("https://www.google.com")
1616
if err != nil {
1717
log.Fatal(err)
1818
}
19+
defer res.Body.Close()
1920
if res.StatusCode != 200 { // want "Magic number: 200, in <condition> detected"
2021
log.Println("Something went wrong")
2122
}
@@ -26,10 +27,11 @@ func UseNoMagicNumber() {
2627
Timeout: time.Second,
2728
}
2829

29-
res, err := c.Get("http://www.google.com")
30+
res, err := c.Get("https://www.google.com")
3031
if err != nil {
3132
log.Fatal(err)
3233
}
34+
3335
if res.StatusCode != http.StatusOK {
3436
log.Println("Something went wrong")
3537
}

0 commit comments

Comments
 (0)