|
@@ -1,10 +1,40 @@
|
|
-package main
|
|
|
|
-
|
|
|
|
-import (
|
|
|
|
- "fmt"
|
|
|
|
-)
|
|
|
|
-
|
|
|
|
-func main() {
|
|
|
|
- foo := 3
|
|
|
|
- fmt.Println(foo)
|
|
|
|
-}
|
|
|
|
|
|
+package main
|
|
|
|
+
|
|
|
|
+import (
|
|
|
|
+ "fmt"
|
|
|
|
+ "strings"
|
|
|
|
+)
|
|
|
|
+
|
|
|
|
+func testStrings() {
|
|
|
|
+ broken := "G# r#cks!"
|
|
|
|
+ replacer := strings.NewReplacer("#", "o")
|
|
|
|
+ fixed := replacer.Replace(broken)
|
|
|
|
+ fmt.Println(fixed)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func main() {
|
|
|
|
+ /*
|
|
|
|
+ var price int = 100.0
|
|
|
|
+ fmt.Println("Price is", price, "dollars.")
|
|
|
|
+
|
|
|
|
+ var taxRate float64 = 0.08
|
|
|
|
+ var tax float64 = float64(price) * taxRate
|
|
|
|
+ fmt.Println("Tax is", tax, "dollars")
|
|
|
|
+
|
|
|
|
+ var total float64 = float64(price) + tax
|
|
|
|
+ fmt.Println("Total cost is", total, "dollars")
|
|
|
|
+
|
|
|
|
+ var aviableFunds int = 120
|
|
|
|
+ fmt.Println(aviableFunds, "dollars available.")
|
|
|
|
+ fmt.Println("Within budget?", total <= float64(aviableFunds))
|
|
|
|
+ */
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ var now time.Time = time.Now()
|
|
|
|
+ var year int = now.Year()
|
|
|
|
+ fmt.Println("Today is", year, "year")
|
|
|
|
+ fmt.Println("Now is", time.Now())
|
|
|
|
+ */
|
|
|
|
+ test_error()
|
|
|
|
+ // testStrings()
|
|
|
|
+}
|