Skip to content

Commit 8283d30

Browse files
committed
Avoid deprecated function in qhelp examples in same folder
1 parent 00cc430 commit 8283d30

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

go/ql/src/Security/CWE-079/StoredXss.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package main
22

33
import (
44
"io"
5-
"io/ioutil"
65
"net/http"
6+
"os"
77
)
88

99
func ListFiles(w http.ResponseWriter, r *http.Request) {
10-
files, _ := ioutil.ReadDir(".")
10+
files, _ := os.ReadDir(".")
1111

1212
for _, file := range files {
1313
io.WriteString(w, file.Name()+"\n")

go/ql/src/Security/CWE-079/StoredXssGood.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ package main
33
import (
44
"html"
55
"io"
6-
"io/ioutil"
76
"net/http"
7+
"os"
88
)
99

1010
func ListFiles1(w http.ResponseWriter, r *http.Request) {
11-
files, _ := ioutil.ReadDir(".")
11+
files, _ := os.ReadDir(".")
1212

1313
for _, file := range files {
1414
io.WriteString(w, html.EscapeString(file.Name())+"\n")

0 commit comments

Comments
 (0)