mirror of
https://github.com/fumiama/terasu.git
synced 2026-06-12 14:10:32 +08:00
chore: make lint happy
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
@@ -15,7 +14,7 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if len(os.Args) != 2 {
|
if len(os.Args) != 2 {
|
||||||
logrus.Infoln("Usage:", os.Args[0], "url")
|
logrus.Infoln("usage:", os.Args[0], "url")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if !strings.HasPrefix(os.Args[1], "https://") {
|
if !strings.HasPrefix(os.Args[1], "https://") {
|
||||||
@@ -32,10 +31,11 @@ func main() {
|
|||||||
logrus.Errorln("status code:", resp.StatusCode)
|
logrus.Errorln("status code:", resp.StatusCode)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
data, err := io.ReadAll(resp.Body)
|
|
||||||
|
_, err = io.Copy(os.Stdout, resp.Body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorln(err)
|
logrus.Errorln(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Print(string(data))
|
logrus.Infoln("success.")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user