小鹿记录

Encoding/Json

The word marshaling means converting from a Go data type to an encoding, and unmarshaling means converting to a Go data type.Marshalling可译作集结、结集、编码、编组

Administrator Administrator 发布于 2023-06-26

Time

DurationA period of time is represented with a time.Duration, a type based on an int64.The smallest amount of time that Go can represent is one nanose

Administrator Administrator 发布于 2023-06-26

IO

readertype Reader interface {Read(p []byte) (n int, err error)}type Writer interface {Write(p []byte) (n int, err error)}The Read method on io.Reader

Administrator Administrator 发布于 2023-06-26

Golang---GoConcurrency

多核 & 多线程多核CPU( CentralProcessingUnit): 中央处理单元,CPU不等于物理核,更不等于逻辑核。物理核(physical core/processor): 可以看的到的,真实的cpu核,有独立的电路元件以及L1,L2缓存,可以独立地执行指令。逻辑核( logi

Administrator Administrator 发布于 2023-03-13

Golang---module

package & directory & importimport path & package clause & export这里,首先,要澄清一个概念,就是directory 与 package,我们看到package,总翻译成包,但是在go中,package其

Administrator Administrator 发布于 2023-03-10

Golang---error

error is a type—the error typethe error is a type ,like int 、string、boolfunc calcRemainderAndMod(numerator, denominator int) (int, int, error) { if

Administrator Administrator 发布于 2023-03-10

Golang---mixed notation easily

Zero Value For Typeint: 0string: “”bool: falseSlice: nilMap: nilstruct: zero value 不是nilnil is a predeclared identifier representing the zero value f

Administrator Administrator 发布于 2023-03-09

Golang---Types & Methods & Interface

Typestype Person struct {FirstName stringLastName stringAge int}this should be read as declaring a user-defined type with the namePerson to hav

Administrator Administrator 发布于 2023-03-08

Golang---Pointers

the basics of using pointerthe variable of pointer type & pointer type我们需要区分2个概念:the variable of pointer typepointer typevar pointerToX *int上面的代码

Administrator Administrator 发布于 2023-03-08