package main标签:string,JoinString,DD,var,go,type,fmt From: https://www.cnblogs.com/cheyunhua/p/16960643.html
import "fmt"
type DD string
const (
C DD = "dd"
D DD = "cc"
)
func (DD) JoinString() DD {
return C + D
}
func main() {
C.JoinString()
D.JoinString()
var c DD
c.JoinString()
var m = make(map[DD]interface{})
m[C] = `netstat -r`
m[D] = `ifconfig`
if t, ok := m[C]; !ok {
panic(t)
} else {
fmt.Println(t)
}
}