摘要:
方法method receiver p selector 形如p.X或p.Path() go可以让任意类型添加方法,可以为一个named type添加方法,只要它的底层不是指针或接口。 当receiver为指针类型时,实例类型调用方法会自动取地址然后调用, 这仅限于变量,包括结构体成员,数组成员,s 阅读全文
posted @ 2022-01-05 16:52
影随风动91
阅读(39)
评论(0)
推荐(0)
摘要:
函数 函数的类型称为函数签名: func signature。 两个函数有相同的参数类型列表和相同的返回结果类型列表,则类型即签名相同。 go没有默认参数和带名称参数。 函数参数通过值复制,因此函数接收的是每个参数的副本。 go的垃圾回收会清理无用的内存,但不会清理系统资源,如打开的文件描述符。 在 阅读全文
posted @ 2022-01-04 18:28
影随风动91
阅读(35)
评论(0)
推荐(0)
摘要:
Go is a compiled language. Go natively handles Unicode, so it can process text in all the world’s languages. Exercis e 1.3: Experiment to measure the 阅读全文
posted @ 2022-01-04 11:45
影随风动91
阅读(21)
评论(0)
推荐(0)
摘要:
Its facilities for concurrency are new and efficient, and its approach to dat a abstraction and object-oriented programming is unusually flexible. It ha 阅读全文
posted @ 2022-01-04 09:38
影随风动91
阅读(25)
评论(0)
推荐(0)
浙公网安备 33010602011771号