mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
Apply remaining changes
Co-authored-by: duke-git <5037603+duke-git@users.noreply.github.com>
This commit is contained in:
1 parent
9903096704
commit
41a0f309dd
4 files changed
+79
-64
No files matched your search
@@ -4,6 +4,8 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"runtime"
|
||||
"sync"
|
||||
@@ -430,7 +432,12 @@ func ExampleWriteBytesToFile() {
|
||||
}
|
||||
|
||||
func ExampleReadFile() {
|
||||
reader, fn, err := ReadFile("https://httpbin.org/robots.txt")
|
||||
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, "User-agent: *\nDisallow: /deny\n")
|
||||
}))
|
||||
defer ts.Close()
|
||||
|
||||
reader, fn, err := ReadFile(ts.URL)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user