Skip to content

Instantly share code, notes, and snippets.

@ryanwebjackson
Created November 18, 2017 22:20
Show Gist options
  • Save ryanwebjackson/b45884184bab494c5d83a0714c208e60 to your computer and use it in GitHub Desktop.
Save ryanwebjackson/b45884184bab494c5d83a0714c208e60 to your computer and use it in GitHub Desktop.
Still trying to understand how the assignments are working here
package main
import "fmt"
const (
tomato, apple int = iota + 1, iota + 2
orange, chevy
ford, _
)
func main() {
fmt.Printf("The value of tomato is %v\n", tomato)
fmt.Printf("The value of apple is %v\n", apple)
fmt.Printf("The value of orange is %v\n", orange)
fmt.Printf("The value of chevy is %v\n", chevy)
fmt.Printf("The value of ford is %v\n", ford)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment