mirror of
https://github.com/avelino/awesome-go.git
synced 2024-11-28 16:56:26 +00:00
ioutil.ReadFile -> os.ReadFile + use constant for README
This commit is contained in:
parent
05fe195266
commit
ed9808b8f1
@ -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)
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user