slicemd

package
v0.0.0-...-9d91cd3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Append

func Append(slice, data []byte) (b []byte)

Append 练习,此时可以看出GO中只有值传递。此时的 append 函数(接收引用类型) 但却是改变的 slice 的一个副本(拷贝)所以不会改变实参。

func AppendByte

func AppendByte(slice []byte, data ...byte) []byte

AppendByte .

func Test1

func Test1()

Test1 一些基本操作 当声明数组时所有的元素都会被自动初始化为默认值 0 数组是值类型,可以通过 new 来创建。

func Test2

func Test2()

Test2 切片的一些常规操作。 切片(slice)是对数组一个连续片段的引用(该数组我们称之为相关数组,通常是匿名的) ,所以切片是一个引用类型 注意 绝对不要用指针指向 slice。切片本身已经是一个引用类型,所以它本身就是一个指针!!

func Test3

func Test3()

Test3 关于切片的扩容和拷贝

func Test4

func Test4()

Test4 字符串、数组、切片 字符串本质上是一个字节数组

Types

This section is empty.

Jump to

Keyboard shortcuts

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