package main
import (
"fmt"
)
type Sender chan<- int
type Receiver <-chan int
func main() {
fmt.Println("Received! 6 ")
fmt.Println("Sent!")
}
import (
"fmt"
)
type Sender chan<- int
type Receiver <-chan int
func main() {
fmt.Println("Received! 6 ")
fmt.Println("Sent!")
}
2017-02-10
type Cat struct {
Name string
Age uint8
Location string
}
func (cat *Cat) Grow() {
// cat.Age++
}
func (cat *Cat) Move(new string) string {
// old := cat.Location
// cat.Location = new
// return old
return ""
}
Name string
Age uint8
Location string
}
func (cat *Cat) Grow() {
// cat.Age++
}
func (cat *Cat) Move(new string) string {
// old := cat.Location
// cat.Location = new
// return old
return ""
}
2017-02-09
type Person struct {
Name string
Gender string
Age uint8
Address string
}
func (person *Person) Move(address string) string {
oldAddress := person.Address
person.Address = address
return oldAddress
}
Name string
Gender string
Age uint8
Address string
}
func (person *Person) Move(address string) string {
oldAddress := person.Address
person.Address = address
return oldAddress
}
2017-02-09
func main() {
var generator EmployeeIdGenerator
generator = func(company string, department string, sn uint32) string {
return appendSn(company+"-"+department+"-", sn)
}
fmt.Println(generateId(generator, "RD"))
}
var generator EmployeeIdGenerator
generator = func(company string, department string, sn uint32) string {
return appendSn(company+"-"+department+"-", sn)
}
fmt.Println(generateId(generator, "RD"))
}
2017-02-09
go func() {
ch2 <- ("已到达!")
}()
var value string = "数据"
value = value + (<-ch2)
fmt.Println(value)
ch2 <- ("已到达!")
}()
var value string = "数据"
value = value + (<-ch2)
fmt.Println(value)
2017-02-09
会java , PHP 也不知老师从哪儿开始讲的 能先介绍下我们该用什么编辑工具吗 配置环境什么都不知道 就在讲工作区什么命令的, 完全听不下去了
2017-02-09
想说一下前面吐槽的同学, 想看更高深的内容可以看作者的书, 比较精辟, 我是看书有很多不懂的, 才来恶补知识的~
2017-01-29