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