青春纸盒子

文: 芦苇

你喜欢我笑的样子

我靠上了落寞的窗子

晚风吹起了我的袖子

明月沾湿了你的眸子


转身,你走出了两个人的圈子

树影婆娑,整座院子


挽起袖子

回头,把揽你忧伤一地的影子

装进,青春,这纸盒子


更多代码请关注我的微信小程序: "ecoder"

luwei0915

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

随笔分类 -  11_Go-基础

1 2 3 4 5 下一页

99_Go基础_1_67 Go语言的值类型和引用类型
摘要:Go语言的值类型和引用类型一、值类型和引用类型区别说明1、值类型:int系列、float系列、bool、string、数组和结构体2、引用类型:指针、slice切片、map、管道chan、interface接口等 二、使用特点1、值类型:直接储存值,栈分配,拷贝直接拷贝所有的值,损伤性能2、引用类型 阅读全文

posted @ 2022-02-22 17:24 芦苇の 阅读(37) 评论(0) 推荐(0) 编辑

98_Go基础_1_66 ioutil 遍历目录
摘要:1 package main 2 3 import ( 4 "fmt" 5 "io/ioutil" 6 "log" 7 ) 8 9 func listFiles(dirname string, level int) { 10 // level用来记录当前递归的层次,生成带有层次感的空格 11 s : 阅读全文

posted @ 2021-12-08 16:25 芦苇の 阅读(53) 评论(0) 推荐(0) 编辑

97_Go基础_1_65 ioutil
摘要:1 package main 2 3 import ( 4 "fmt" 5 "io/ioutil" 6 "os" 7 ) 8 9 func main() { 10 /* 11 ioutil包: 12 ReadFile() 13 WriteFile() 14 ReadDir() 15 .. 16 */ 阅读全文

posted @ 2021-12-08 16:19 芦苇の 阅读(57) 评论(0) 推荐(0) 编辑

96_Go基础_1_64 bufio-write
摘要:1 package main 2 3 import ( 4 "bufio" 5 "fmt" 6 "os" 7 ) 8 9 func main() { 10 /* 11 bufio:高效io读写 12 buffer缓存 13 io:input/output 14 15 将io包下的Reader,Wri 阅读全文

posted @ 2021-12-08 15:38 芦苇の 阅读(38) 评论(0) 推荐(0) 编辑

95_Go基础_1_63 bufio
摘要:1 package main 2 3 import ( 4 "bufio" 5 "fmt" 6 "os" 7 ) 8 9 func main() { 10 /* 11 bufio:高效io读写 12 buffer缓存 13 io:input/output 14 15 将io包下的Reader,Wri 阅读全文

posted @ 2021-12-08 14:52 芦苇の 阅读(25) 评论(0) 推荐(0) 编辑

94_Go基础_1_62 断点续传
摘要:1 package main 2 3 import ( 4 "fmt" 5 "io" 6 "log" 7 "os" 8 "strconv" 9 "strings" 10 ) 11 12 func HandleErr(err error) { 13 if err != nil { 14 log.Fat 阅读全文

posted @ 2021-12-08 14:37 芦苇の 阅读(31) 评论(0) 推荐(0) 编辑

93_Go基础_1_61 偏移量 seek
摘要:1 package main 2 3 import ( 4 "fmt" 5 "io" 6 "log" 7 "os" 8 ) 9 10 func main() { 11 /* 12 Seek(offset int64, whence int) (int64, error),设置指针光标的位置 13 第 阅读全文

posted @ 2021-12-08 13:42 芦苇の 阅读(118) 评论(0) 推荐(0) 编辑

92_Go基础_1_60 拷贝文件
摘要:1 package main 2 3 import ( 4 "fmt" 5 "io" 6 "io/ioutil" 7 "os" 8 ) 9 10 // 该函数:用于通过io操作实现文件的拷贝,返回值是拷贝的总数量(字节),错误 11 func CopyFile1(srcFile, destFile 阅读全文

posted @ 2021-12-08 12:18 芦苇の 阅读(30) 评论(0) 推荐(0) 编辑

91_Go基础_1_59 file.Write
摘要:1 package main 2 3 import ( 4 "fmt" 5 "log" 6 "os" 7 ) 8 9 func HandleErr(err error) { 10 if err != nil { 11 log.Fatal(err) 12 } 13 } 14 15 func main( 阅读全文

posted @ 2021-12-03 17:56 芦苇の 阅读(27) 评论(0) 推荐(0) 编辑

90_Go基础_1_58 read
摘要:1 package main 2 3 import ( 4 "fmt" 5 "io" 6 "os" 7 ) 8 9 func main() { 10 /* 11 读取数据: 12 Reader接口: 13 Read(p []byte)(n int, error) 14 */ 15 16 // ste 阅读全文

posted @ 2021-12-03 17:07 芦苇の 阅读(28) 评论(0) 推荐(0) 编辑

89_Go基础_1_57 IO操作
摘要:1 package main 2 3 import ( 4 "fmt" 5 "os" 6 "path/filepath" 7 ) 8 9 func main() { 10 /* 11 文件操作: 12 1.路径: 13 相对路径:relative 14 ab.txt 15 相对于当前工程 16 绝对 阅读全文

posted @ 2021-12-03 16:43 芦苇の 阅读(41) 评论(0) 推荐(0) 编辑

88_Go基础_1_56 os.Stat
摘要:1 package main 2 3 import ( 4 "fmt" 5 "os" 6 ) 7 8 func main() { 9 /* 10 FileInfo:文件信息 11 interface 12 Name(),文件名 13 Size(),文件大小,字节为单位 14 IsDir(),是否是目 阅读全文

posted @ 2021-12-03 16:04 芦苇の 阅读(76) 评论(0) 推荐(0) 编辑

87_Go基础_1_55 panic and recover
摘要:1 package main 2 3 import "fmt" 4 5 func myprint(s string) { 6 fmt.Println(s) 7 } 8 9 func funA() { 10 fmt.Println("我是一个函数funA()....") 11 } 12 13 func 阅读全文

posted @ 2021-12-03 15:56 芦苇の 阅读(24) 评论(0) 推荐(0) 编辑

86_Go基础_1_54 自定义结构体实现错误2
摘要:1 package main 2 3 import "fmt" 4 5 type areaError struct { 6 msg string // 错误的描述 7 lenght float64 // 发生错误的时候,矩形的长度 8 width float64 // 发生错误的时候,矩形的宽度 9 阅读全文

posted @ 2021-12-02 19:00 芦苇の 阅读(31) 评论(0) 推荐(0) 编辑

85_Go基础_1_53 自定义结构体实现错误
摘要:1 package main 2 3 import ( 4 "fmt" 5 "math" 6 ) 7 8 //1.定义一个结构体,表示错误的类型 9 type areaError struct { 10 msg string 11 radius float64 12 } 13 14 // 2.实现e 阅读全文

posted @ 2021-12-02 18:40 芦苇の 阅读(44) 评论(0) 推荐(0) 编辑

84_Go基础_1_52 net error
摘要:1 package main 2 3 import ( 4 "fmt" 5 "net" 6 ) 7 8 func main() { 9 addr, err := net.LookupHost("www.baidu.com") 10 fmt.Println(err) 11 if ins, ok := 阅读全文

posted @ 2021-12-02 16:18 芦苇の 阅读(26) 评论(0) 推荐(0) 编辑

83_Go基础_1_51 其他创建 error 的方法
摘要:1 package main 2 3 import ( 4 "errors" 5 "fmt" 6 ) 7 8 // 设计一个函数:验证年龄是否合法,如果为负数,就返回一个error 9 func checkAge(age int) error { 10 if age < 0 { 11 //返回err 阅读全文

posted @ 2021-12-02 16:15 芦苇の 阅读(113) 评论(0) 推荐(0) 编辑

82_Go基础_1_50 error
摘要:1 package main 2 3 import ( 4 "fmt" 5 "os" 6 ) 7 8 func main() { 9 f, err := os.Open("test.txt") 10 if err != nil { 11 //log.Fatal(err) 12 fmt.Println 阅读全文

posted @ 2021-12-02 16:08 芦苇の 阅读(26) 评论(0) 推荐(0) 编辑

81_Go基础_1_49 结构体别名
摘要:1 package main 2 3 import "fmt" 4 5 type Person struct { 6 name string 7 } 8 9 func (p Person) show() { 10 fmt.Println("Person >", p.name) 11 } 12 13 阅读全文

posted @ 2021-12-02 15:23 芦苇の 阅读(46) 评论(0) 推荐(0) 编辑

80_Go基础_1_48 类型别名、类型定义
摘要:1 package main 2 3 import ( 4 "fmt" 5 "strconv" 6 ) 7 8 // 1.定义一个新的类型 9 type myint int 10 type mystr string 11 12 // 2.定义函数类型 13 type myfun func(int, 阅读全文

posted @ 2021-12-02 14:57 芦苇の 阅读(32) 评论(0) 推荐(0) 编辑

1 2 3 4 5 下一页
点击右上角即可分享
微信分享提示