var 目标变量 = 源变量[开始索引:结束索引]
目标变量的长度是源变量的 (结束索引 - 开始索引)
目标变量的容量是源变量的 (容量 - 开始索引)
目标变量的长度是源变量的 (结束索引 - 开始索引)
目标变量的容量是源变量的 (容量 - 开始索引)
2021-11-28
generator = func (company string, department string, sn uint32) string{
var name = company+"-"+department+"-"
return appendSn(name,sn)
}
var name = company+"-"+department+"-"
return appendSn(name,sn)
}
2021-11-26
func myfunc(company string, department string, sn uint32) string{
var name = company+"-"+department+"-"
return appendSn(name,sn)
}
generator = myfunc
var name = company+"-"+department+"-"
return appendSn(name,sn)
}
generator = myfunc
2021-11-26
package main
import "fmt"
func main() {
ch2 := make(chan string, 1)
go func() {
ch2 <- ("已到达!")
}()
var value string = "数据"
// val := <- ch2
// value = value + val
value=value+(<-ch2)
fmt.Println(value)
}
import "fmt"
func main() {
ch2 := make(chan string, 1)
go func() {
ch2 <- ("已到达!")
}()
var value string = "数据"
// val := <- ch2
// value = value + val
value=value+(<-ch2)
fmt.Println(value)
}
2021-11-23