aboutsummaryrefslogtreecommitdiff
path: root/content/constants/string2.go
diff options
context:
space:
mode:
Diffstat (limited to 'content/constants/string2.go')
-rw-r--r--content/constants/string2.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/content/constants/string2.go b/content/constants/string2.go
new file mode 100644
index 0000000..362b484
--- /dev/null
+++ b/content/constants/string2.go
@@ -0,0 +1,16 @@
+// +build OMIT
+
+package main
+
+import "fmt"
+
+const typedHello string = "Hello, 世界"
+
+func main() {
+ // START OMIT
+ type MyString string
+ var m MyString
+ m = typedHello // Type error
+ fmt.Println(m)
+ // STOP OMIT
+}