stop using ioutil

Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
Naman Sood 2021-02-19 18:02:02 -05:00
parent f223051b68
commit 038695d123
2 changed files with 4 additions and 5 deletions

View file

@ -3,7 +3,6 @@ package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
@ -47,7 +46,7 @@ func newServer() (*server, error) {
}
func (s *server) refreshPages() error {
files, err := ioutil.ReadDir("posts/")
files, err := os.ReadDir("posts/")
if err != nil {
return err
}
@ -136,7 +135,7 @@ func loadRegularStylesheet(filename string) error {
}
func (s *server) refreshStyles() error {
styles, err := ioutil.ReadDir("styles/")
styles, err := os.ReadDir("styles/")
if err != nil {
return fmt.Errorf("Could not load styles directory: %s", err)
}