Exercises & activities from the go workshop provided by Packt: https://courses.packtpub.com/courses/go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

24 lines
382 B

package main
import "fmt"
type id string
func getIDs() (id, id, id) {
var id1 id
var id2 id = "1234-5678"
var id3 id
id3 = "1234-5678"
return id1, id2, id3
}
func main() {
id1, id2, id3 := getIDs()
fmt.Println("id1 == id2: ", id1 == id2)
fmt.Println("id2 == id3: ", id2 == id3)
fmt.Println("id2 == \"1234-5678\"", string(id2) == "1234-5678")
}