summaryrefslogtreecommitdiff
path: root/tools/sw-fetch/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sw-fetch/main.go')
-rw-r--r--tools/sw-fetch/main.go19
1 files changed, 1 insertions, 18 deletions
diff --git a/tools/sw-fetch/main.go b/tools/sw-fetch/main.go
index 8591fe2..c2cb3e8 100644
--- a/tools/sw-fetch/main.go
+++ b/tools/sw-fetch/main.go
@@ -1,7 +1,6 @@
package main
import (
- "bytes"
"crypto/tls"
"fmt"
"io"
@@ -38,12 +37,7 @@ func main() {
var err error
if conf.upload {
- body, er := stdinContents()
- if er != nil {
- err = er
- } else {
- response, err = cl.Upload(conf.url.String(), body)
- }
+ response, err = cl.Upload(conf.url.String(), os.Stdin)
} else {
response, err = cl.Fetch(conf.url.String())
}
@@ -155,17 +149,6 @@ func failf(msg string, args ...any) {
os.Exit(1)
}
-func stdinContents() (*io.LimitedReader, error) {
- contents, err := io.ReadAll(os.Stdin)
- if err != nil {
- return nil, err
- }
- return &io.LimitedReader{
- R: bytes.NewBuffer(contents),
- N: int64(len(contents)),
- }, nil
-}
-
func printResponse(response *sliderule.Response, conf config) bool {
success := true