study

package
v0.0.0-...-fc5fa47 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayGrammer

func ArrayGrammer()

* go的数组的元素必须为同一种数据类型,声明时必须指定类型 * go的数组长度是固定的,声明时指定长度或者根据赋值时个数由go来自动推断(必须是声明时赋值才可以推断)

func ChannelDemo

func ChannelDemo()

* 关闭通道并不会丢失里面的数据,只是让读取通道数据的时候不会读完之后一直阻塞等待新数据写入(这句话挺精辟的)

func ChannelWithBuffer

func ChannelWithBuffer()

func ClassDemo

func ClassDemo()

生成狗和猫得实例

func ConcurrentDemo

func ConcurrentDemo()

func DeferDemo

func DeferDemo()

此小样照抄自: https://zhuanlan.zhihu.com/p/63354092

func FakeMain

func FakeMain()

开启三个线程

func InterfaceDemo

func InterfaceDemo()

func MapDemo

func MapDemo()

func Pointer

func Pointer()

* 指针的定义:一个指针变量指向了一个值的内存地址。 * 在变量的类型前面使用 * 符号以声明此变量为指针变量 * 指针变量储存的是值的内存地址,在变量前加上 * 符号以访问这个指针变量的值(获取内存地址上的内容)

func RangeDemo

func RangeDemo()

func SliceDemo

func SliceDemo()

func Struct

func Struct()

使用结构体

func StudentClass

func StudentClass()

从这个示例可以看出 struct 几乎等于 类 结构体类型的方法名不能和属性重名也不能这个类型的其他方法重名

func Study

func Study()

func TypeTranslate

func TypeTranslate()

Types

type Animal

type Animal struct {
	Age     int
	Species string
	// contains filtered or unexported fields
}

type Chevrolet

type Chevrolet struct {
	// contains filtered or unexported fields
}

type Ford

type Ford struct {
	// contains filtered or unexported fields
}

type Sale

type Sale interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL