代码拉取完成,页面将自动刷新
package main
import "fmt"
func main() {
// 示例1
{
type MyString = string
str := "BCD"
myStr1 := MyString(str)
myStr2 := MyString("A" + str)
fmt.Printf("%T(%q) == %T(%q): %v\n",
str, str, myStr1, myStr1, str == myStr1)
fmt.Printf("%T(%q) > %T(%q): %v\n",
str, str, myStr2, myStr2, str > myStr2)
fmt.Printf("Type %T is the same as type %T.\n", myStr1, str)
strs := []string{"E", "F", "G"}
myStrs := []MyString(strs)
fmt.Printf("A value of type []MyString: %T(%q)\n",
myStrs, myStrs)
fmt.Printf("Type %T is the same as type %T.\n", myStrs, strs)
fmt.Println()
}
// 示例2
// {
// type MyString string
// str := "BCD"
// myStr1 := MyString(str)
// myStr2 := MyString("A" + str)
// _ = myStr2
// fmt.Printf("%T(%q) == %T(%q): %v\n",
// str, str, myStr1, myStr1, str == myStr1)
// fmt.Printf("%T(%q) > %T(%q): %v\n",
// str, str, myStr2, myStr2, str > myStr2)
// fmt.Printf("Type %T is different from type %T.\n", myStr1, str)
// strs := []string{"E", "F", "G"}
// var myStrs []MyString
// myStrs := []MyString(strs)
// fmt.Printf("A value of type []MyString: %T(%q)\n",
// myStrs, myStrs)
// fmt.Printf("Type %T is different from type %T.\n", myStr1, str)
// }
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。