data

package
v0.0.0-...-385762f Latest Latest
Warning

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

Go to latest
Published: May 1, 2021 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendWithSlice

func AppendWithSlice(slice, data []byte) []byte

func GetAddArr

func GetAddArr() (result []int, err error)

func InsertSlice

func InsertSlice()

func NewMake

func NewMake()

func NewSyncBuffer

func NewSyncBuffer() error

go存在两种分配对象的方式,new | make new 创建一个内存对象的引用地址,即指针引用,并非初始化对象

func Sum

func Sum(arr []int32) int32

GO传递数组的时候是一个值引用,并非指针的引用,值引用会copy数组所有的元素(深拷贝)

func Sum2

func Sum2(arr *[]int) int

可以考虑是指针,但是GO不惯用,而是使用分片来取代

Types

type MyOOP

type MyOOP struct {
	// contains filtered or unexported fields
}
var OOP MyOOP

func IsMyOOPType

func IsMyOOPType(v1 interface{}) (*MyOOP, bool)

类型断言

func IsMyOOPType2

func IsMyOOPType2(v1 interface{}) (*MyOOP, bool)

func (*MyOOP) Count

func (t *MyOOP) Count() int32

type Person

type Person struct {
	Name    string
	Age     int32
	Address string
	Email   string
}

func NewPerson

func NewPerson(name string) *Person

对象构造器

func NewPerson2

func NewPerson2(name string) *Person

type Status

type Status int32

自定义类型

const (
	CREATED   Status = 1
	ORDERED   Status = 2
	FINISHED  Status = 3
	CANCELLED Status = 4
)

type SyncedBuffer

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

Jump to

Keyboard shortcuts

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