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:
parent
05fe195266
commit
ed9808b8f1
2 changed files with 4 additions and 5 deletions
|
@ -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 a new issue