This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... the rest of the main.go file is here... | |
var runes []rune | |
for _, r := range "Language: 走" { | |
runes = append(runes, r) | |
} | |
fmt.Printf("%q \n", runes) | |
var x, y []int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
months := [...]string{1: "January", 2:"February", 3: "March", 4:"April", 12:"December"} | |
for _, s := range months { | |
fmt.Printf("The month: %s\n", s) | |
} | |
var runes []rune | |
for _, r := range "Language: 走" { | |
runes = append(runes, r) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmt.Println("Hello, let's talk composite types.") | |
basketOfStuff := [3]string{"The first string","second","This string."} | |
var zeeValues [2]int | |
for i, v := range basketOfStuff { | |
fmt.Printf("Value %d: %s\n", i, v) | |
} | |
fmt.Println(zeeValues) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Currency int | |
const ( | |
USD Currency = iota | |
CAN | |
EUR | |
GBP | |
JPY | |
NOK | |
SEK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"math" | |
"strconv" | |
) | |
const ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
"strconv" | |
) | |
func main() { | |
var someInt int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
const( | |
MinUint uint = 0 // all zeroes | |
// Perform a bitwise NOT to change every bit from 0 to 1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
randomdata "github.com/Pallinder/go-randomdata" | |
) | |
func main() { | |
// Print a random silly name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
tempconv "github.com/Adron/awesomeProject/tempconv" | |
) | |
func main() { | |
fmt.Println("Temperatures are hard to figure off the top of one's mind!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tempconv | |
type Celsius float64 | |
type Fahrenheit float64 | |
const ( | |
AbsoluteZeroC Celsius = -273.15 | |
FreezingC Celsius = 0 | |
BoilingC Celsius = 100 | |
) |