Skip to content

Instantly share code, notes, and snippets.

@coolbrg
Forked from meson10/types.go
Last active August 29, 2015 14:11
Show Gist options
  • Save coolbrg/22a3c02a68d76038601a to your computer and use it in GitHub Desktop.
Save coolbrg/22a3c02a68d76038601a to your computer and use it in GitHub Desktop.
package main
import "fmt"
type myInt int
const unTypedC = 20
const typedC int = 30
func main() {
var typedInt int
var c myInt
typedInt = 10
impliedInt := 40
c = 20
impliedInt = c //Won't Work
c = typedInt //Won't work
c = unTypedC
c = typedC // Won't work
fmt.Println(c, typedInt, impliedInt)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment