cleanup
authorwatkinsr <ryanwatkins54@gmail.com>
Mon, 1 Jun 2020 02:04:11 +0000 (03:04 +0100)
committerwatkinsr <ryanwatkins54@gmail.com>
Mon, 1 Jun 2020 02:04:11 +0000 (03:04 +0100)
dup/dup1.go [moved from dup1.go with 100% similarity]
dup/dup2.go [moved from dup2.go with 100% similarity]
dup/dup3 [moved from dup3 with 100% similarity]
dup/dup3.go [moved from dup3.go with 100% similarity]
echo/echo1.go [moved from echo1.go with 100% similarity]
echo/echo2.go [moved from echo2.go with 100% similarity]
echo/echo3.go [moved from echo3.go with 100% similarity]
echo/echo4.go [moved from echo4.go with 100% similarity]
fetch/fetch.go [new file with mode: 0644]
helloworld.go [deleted file]
lissajous/test.go [new file with mode: 0644]

similarity index 100%
rename from dup1.go
rename to dup/dup1.go
similarity index 100%
rename from dup2.go
rename to dup/dup2.go
diff --git a/dup3 b/dup/dup3
similarity index 100%
rename from dup3
rename to dup/dup3
similarity index 100%
rename from dup3.go
rename to dup/dup3.go
similarity index 100%
rename from echo1.go
rename to echo/echo1.go
similarity index 100%
rename from echo2.go
rename to echo/echo2.go
similarity index 100%
rename from echo3.go
rename to echo/echo3.go
similarity index 100%
rename from echo4.go
rename to echo/echo4.go
diff --git a/fetch/fetch.go b/fetch/fetch.go
new file mode 100644 (file)
index 0000000..0712553
--- /dev/null
@@ -0,0 +1,24 @@
+// Fetch prints the content found at a URL.
+package main
+import (
+  "fmt"
+  "io/ioutil"
+  "net/http"
+  "os"
+)
+func main() {
+  for _, url := range os.Args[1:] {
+    resp, err := http.Get(url)
+    if err != nil {
+      fmt.Fprintf(os.Stderr, "fetch: %v\n", err)
+      os.Exit(1)
+    }
+    b, err := ioutil.ReadAll(resp.Body)
+    resp.Body.Close()
+    if err != nil {
+      fmt.Fprintf(os.Stderr, "fetch: reading %s: %v\n", url, err)
+      os.Exit(1)
+    }
+    fmt.Printf("%s", b)
+  }
+}
diff --git a/helloworld.go b/helloworld.go
deleted file mode 100644 (file)
index f7b60bd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package main
-
-import "fmt"
-
-func main() {
-       fmt.Println("Hello, world!")
-}
diff --git a/lissajous/test.go b/lissajous/test.go
new file mode 100644 (file)
index 0000000..6fd6e45
--- /dev/null
@@ -0,0 +1,9 @@
+package main
+
+
+import (
+  "os"
+)
+
+func main(){
+}