golang.org/toolchain@v0.0.1-go1.9rc2.windows-amd64/blog/content/constants/string3.go (about)

     1  // +build OMIT
     2  
     3  package main
     4  
     5  import "fmt"
     6  
     7  const typedHello string = "Hello, 世界"
     8  
     9  func main() {
    10  	type MyString string
    11  	var m MyString
    12  	// START OMIT
    13  	const myStringHello MyString = "Hello, 世界"
    14  	m = myStringHello // OK
    15  	fmt.Println(m)
    16  	// STOP OMIT
    17  }