Avoid deprecated function in qhelp examples in same folder

This commit is contained in:
Owen Mansel-Chan
2025-05-01 15:51:03 +01:00
parent 00cc430ac3
commit 8283d30d94
2 changed files with 4 additions and 4 deletions

View File

@@ -2,12 +2,12 @@ package main
import (
"io"
"io/ioutil"
"net/http"
"os"
)
func ListFiles(w http.ResponseWriter, r *http.Request) {
files, _ := ioutil.ReadDir(".")
files, _ := os.ReadDir(".")
for _, file := range files {
io.WriteString(w, file.Name()+"\n")

View File

@@ -3,12 +3,12 @@ package main
import (
"html"
"io"
"io/ioutil"
"net/http"
"os"
)
func ListFiles1(w http.ResponseWriter, r *http.Request) {
files, _ := ioutil.ReadDir(".")
files, _ := os.ReadDir(".")
for _, file := range files {
io.WriteString(w, html.EscapeString(file.Name())+"\n")