mirror of
https://git.sr.ht/~adnano/go-gemini
synced 2024-11-23 12:42:13 +01:00
Only use fs.go when fs.FS is available
This commit is contained in:
parent
36a67255e0
commit
0431ad1d45
2
fs.go
2
fs.go
@ -1,3 +1,5 @@
|
||||
// +build 1.16
|
||||
|
||||
package gemini
|
||||
|
||||
import (
|
||||
|
2
go.mod
2
go.mod
@ -1,5 +1,5 @@
|
||||
module git.sr.ht/~adnano/go-gemini
|
||||
|
||||
go 1.16
|
||||
go 1.15
|
||||
|
||||
require golang.org/x/net v0.0.0-20210119194325-5f4716e94777
|
||||
|
@ -2,6 +2,7 @@ package gemini
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@ -82,7 +83,7 @@ func TestReadWriteResponse(t *testing.T) {
|
||||
|
||||
for _, test := range tests {
|
||||
t.Logf("%#v", test.Raw)
|
||||
resp, err := ReadResponse(io.NopCloser(strings.NewReader(test.Raw)))
|
||||
resp, err := ReadResponse(ioutil.NopCloser(strings.NewReader(test.Raw)))
|
||||
if err != test.Err {
|
||||
t.Errorf("expected err = %v, got %v", test.Err, err)
|
||||
}
|
||||
@ -96,7 +97,7 @@ func TestReadWriteResponse(t *testing.T) {
|
||||
if resp.Meta != test.Meta {
|
||||
t.Errorf("expected meta = %s, got %s", test.Meta, resp.Meta)
|
||||
}
|
||||
b, _ := io.ReadAll(resp.body)
|
||||
b, _ := ioutil.ReadAll(resp.body)
|
||||
body := string(b)
|
||||
if body != test.Body {
|
||||
t.Errorf("expected body = %#v, got %#v", test.Body, body)
|
||||
|
Loading…
Reference in New Issue
Block a user