From cdc3184c30c45bb8a5414f278aadc45d95cb73f7 Mon Sep 17 00:00:00 2001 From: Mark McGranaghan Date: Wed, 17 Oct 2012 12:51:33 -0700 Subject: [PATCH] publish values --- examples.txt | 2 +- examples/values/values.go | 15 ++++++++------- examples/values/values.sh | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples.txt b/examples.txt index 28a79f4..dc189e3 100644 --- a/examples.txt +++ b/examples.txt @@ -1,5 +1,5 @@ Hello World -# Values +Values # Variables # Short Declarations # Constants diff --git a/examples/values/values.go b/examples/values/values.go index f7852ef..bbaac3d 100644 --- a/examples/values/values.go +++ b/examples/values/values.go @@ -1,20 +1,21 @@ -// Go has various value types, including strings, -// different types of numbers, booleans, etc. +// Go has various value types including strings, +// integers, floats, booleans, etc. Here are a few +// basic examples. + package main import "fmt" func main() { - // Here are some strings, which can be added together. - fmt.Println("Hello world") - fmt.Println("Hello " + "other") + // Strings, which can be added together with `+`. + fmt.Println("Hello " + "world") - // Some examples of integers and floats. + // Integers and floats. fmt.Println("1+1 =", 1+1) fmt.Println("7.0/3.0 =", 7.0/3.0) - // And booleans, which work as you'd expect. + // Booleans, with boolean operators as you'd expect. fmt.Println(true && false) fmt.Println(true || false) fmt.Println(!true) diff --git a/examples/values/values.sh b/examples/values/values.sh index 2d937cf..050a4a0 100644 --- a/examples/values/values.sh +++ b/examples/values/values.sh @@ -1,6 +1,5 @@ $ go run values.go Hello world -Hello other 1+1 = 2 7.0/3.0 = 2.3333333333333335 false