1
0
Fork 0
mirror of https://github.com/avelino/awesome-go.git synced 2024-11-20 11:16:22 -05:00

ioutil.ReadFile -> os.ReadFile + use constant for README

This commit is contained in:
Kirill Zhuravlev 2023-02-14 18:30:51 +01:00 committed by Avelino
parent 05fe195266
commit ed9808b8f1
No known key found for this signature in database
GPG key ID: B345B4D52E98180A
2 changed files with 4 additions and 5 deletions

View file

@ -1,7 +1,7 @@
package main
import (
"io/ioutil"
"os"
"regexp"
"sort"
"strings"
@ -49,7 +49,7 @@ func TestDuplicatedLinks(t *testing.T) {
// Test if an entry has description, it must be separated from link with ` - `
func TestSeparator(t *testing.T) {
var matched, containsLink, noDescription bool
input, err := ioutil.ReadFile("./README.md")
input, err := os.ReadFile(readmePath)
if err != nil {
panic(err)
}

View file

@ -3,7 +3,6 @@ package main
import (
"bytes"
"html/template"
"io/ioutil"
"os"
"github.com/PuerkitoBio/goquery"
@ -11,7 +10,7 @@ import (
)
func readme() []byte {
input, err := os.ReadFile("./README.md")
input, err := os.ReadFile(readmePath)
if err != nil {
panic(err)
}
@ -37,7 +36,7 @@ type content struct {
// GenerateHTML generate site html (index.html) from markdown file
func GenerateHTML(srcFilename, outFilename string) error {
input, err := ioutil.ReadFile(srcFilename)
input, err := os.ReadFile(srcFilename)
if err != nil {
return err
}