summaryrefslogtreecommitdiff
path: root/wget.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-25 00:39:14 -0600
committerJeff Carr <[email protected]>2024-01-25 00:39:14 -0600
commit41fe4a4659d50d70a835224405490588019d24ff (patch)
treedd6677fb17d11a4233568fddf0d3a141434bba10 /wget.go
parente24c2c2eb3feb5083a74a9b2cb396bcbcb0ac52d (diff)
new homev0.13.0
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'wget.go')
-rw-r--r--wget.go13
1 files changed, 6 insertions, 7 deletions
diff --git a/wget.go b/wget.go
index a1ecef0..bd767d6 100644
--- a/wget.go
+++ b/wget.go
@@ -1,6 +1,6 @@
package shell
-/*
+/*
This simply parses the command line arguments using the default golang
package called 'flag'. This can be used as a simple template to parse
command line arguments in other programs.
@@ -11,17 +11,17 @@ package shell
*/
import (
+ "bytes"
+ "fmt"
"io"
+ "net/http"
"os"
- "fmt"
- "bytes"
"strings"
- "net/http"
"go.wit.com/log"
)
-func Wget(url string) (*bytes.Buffer) {
+func Wget(url string) *bytes.Buffer {
buf := new(bytes.Buffer)
// Get the data
@@ -33,7 +33,7 @@ func Wget(url string) (*bytes.Buffer) {
defer resp.Body.Close()
log.Log(INFO, "res.StatusCode: %d\n", resp.StatusCode)
- if (resp.StatusCode != 200) {
+ if resp.StatusCode != 200 {
handleError(fmt.Errorf(fmt.Sprint("%d", resp.StatusCode)), -1)
return nil
}
@@ -72,7 +72,6 @@ func WgetToFile(filepath string, url string) error {
// package. I will quote the evilwm man page:
//
// BUGS: The author's idea of friendly may differ to that of many other people.
-//
func Write(filepath string, data string) bool {
// TODO: this isn't working for some reason and is making two '\n' chars
// probably because Chomp() isn't fixed yet