mirror of
https://github.com/danog/gojekyll.git
synced 2025-01-22 23:11:26 +01:00
TIL io.WriteString
This commit is contained in:
parent
59316fde63
commit
50c7d4b28e
@ -83,6 +83,6 @@ func (p *Pipeline) WriteSass(w io.Writer, b []byte) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = w.Write([]byte(s))
|
||||
_, err = io.WriteString(w, s)
|
||||
return err
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package server
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -17,7 +18,7 @@ func TestTagInjector(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
out := new(bytes.Buffer)
|
||||
w := TagInjector{out, []byte(":insertion:")}
|
||||
_, err := w.Write([]byte(test.in))
|
||||
_, err := io.WriteString(w, test.in)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, test.out, out.String())
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ outer:
|
||||
}
|
||||
case html.TextToken:
|
||||
if body {
|
||||
s := (string(z.Text()))
|
||||
s := string(z.Text())
|
||||
_, err := buf.WriteString(fn(s))
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
@ -56,7 +56,7 @@ func TestVisitCreatedFile(t *testing.T) {
|
||||
err = f.Close()
|
||||
require.NoError(t, err)
|
||||
err = VisitCreatedFile(f.Name(), func(w io.Writer) error {
|
||||
_, e := w.Write([]byte("test"))
|
||||
_, e := io.WriteString(w, "test")
|
||||
return e
|
||||
})
|
||||
require.NoError(t, err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user