aboutsummaryrefslogtreecommitdiff
path: root/content/constants/int1.go
diff options
context:
space:
mode:
Diffstat (limited to 'content/constants/int1.go')
-rw-r--r--content/constants/int1.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/content/constants/int1.go b/content/constants/int1.go
new file mode 100644
index 0000000..913ad78
--- /dev/null
+++ b/content/constants/int1.go
@@ -0,0 +1,18 @@
+// +build OMIT
+
+package main
+
+import "fmt"
+
+func main() {
+ // START OMIT
+ type MyInt int
+ const Three = 3
+ const TypedThree int = 3
+ var mi MyInt
+ mi = 3 // OK
+ mi = Three // OK
+ mi = TypedThree // Bad
+ fmt.Println(mi)
+ // STOP OMIT
+}