Skip to content

Instantly share code, notes, and snippets.

@meson10
Created December 14, 2014 15:12
Show Gist options
  • Save meson10/6a28b77e8d01fa0699b1 to your computer and use it in GitHub Desktop.
Save meson10/6a28b77e8d01fa0699b1 to your computer and use it in GitHub Desktop.
types in go.
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