Skip to content

翻了车的老司机

其实我一直在你身边

Search for:

五月 2018Monthly Archives

GOLANG学习32. 命令行参数获取

flag.StringVar(&confPath, “c”, “”, “please input confPath”)
flag.IntVar(&logLevel, “d”, 10, “please input log level”)

  • Posted on: 2018年5月24日 2018年5月24日
  • Author: zzs10086
  • Categories: go

GOLANG学习31. 文件读取,一次性读取文件内容

str, err := ioutil.ReadFile(“C:/test.txt”)

  • Posted on: 2018年5月24日 2018年5月24日
  • Author: zzs10086
  • Categories: go

GOLANG学习30. 文件读取,逐行读取文件

把文件内容读到内存里,再逐行读取
reader := bufio.NewReader(file)
str, _, err := reader.ReadLine()

  • Posted on: 2018年5月24日 2018年5月24日
  • Author: zzs10086
  • Categories: go

GOLANG学习29. 反射获取字段、方法、调用

numOfMethod := val.NumMethod()
numOfFeild := val.NumField()

  • Posted on: 2018年5月23日 2018年5月23日
  • Author: zzs10086
  • Categories: go

GOLANG学习28. 反射

反射:可以在运行时冬天的获取变量的相关信息
类型 t := reflect.TypeOf(i)
值 v := reflect.ValueOf(i)
类别 k := v.Kind()

  • Posted on: 2018年5月23日 2018年5月23日
  • Author: zzs10086
  • Categories: go

GOLANG学习27. 接口定义

结构体struct 实现了接口的方法,就自动实现了接口的定义

  • Posted on: 2018年5月22日 2018年5月22日
  • Author: zzs10086
  • Categories: go

GOLANG学习26. 结构体继承

如果一个struct 嵌套了另一个匿名结构体,那么这个struct 可以直接访问这个匿名结构体里面的方法和字段,从而实现继承
如果一个struct 嵌套了另一个有名的结构体,那么这个模式就叫组合

  • Posted on: 2018年5月22日 2018年5月22日
  • Author: zzs10086
  • Categories: go

GOLANG学习25. 结构体方法

定义:func (recevier type) methodName(参数列表)(返回值列表){}

  • Posted on: 2018年5月22日 2018年5月22日
  • Author: zzs10086
  • Categories: go

GOLANG学习24. 定义链表

type Student struct {
Name string
Age int

Score float32
Next *Student
}
链表在内存里可以不是连续存储的,数组是连续存储的,链表包括单项链表,和双向链表,通过指针指向下一个或者上个结构体地址

  • Posted on: 2018年5月21日 2018年5月21日
  • Author: zzs10086
  • Categories: go

GOLANG学习23. 定义结构体

type Student struct {
Name string
Age int
Score float32
}
首字母大写代表可以被外包能访问,也就是public作用域

  • Posted on: 2018年5月21日 2020年10月12日
  • Author: zzs10086
  • Categories: go

Pagination

Page: 1 Page: 2 Page: 3 Page: 4 Next page

分类目录

  • docker
  • elasticsearch
  • git
  • go
  • java
  • javascript
  • laravel
  • Linux
  • mysql
  • nginx
  • node.js
  • php
  • redis
  • shell
  • vue
  • webpack
  • 小程序
Search for:
2018年五月
一 二 三 四 五 六 日
« 4月   8月 »
 123456
78910111213
14151617181920
21222324252627
28293031  

近期文章

  • wordpress如何开启全站https
  • CentOS上安装Redis
  • ECMAScript 数组遍历
  • ECMAScript 数组
  • Ecmascript Push 和 Pop 方法

近期评论

    © 2025 翻了车的老司机. 我在你身边绕了一个圈,回到原点你却已在远方。

    苏ICP备16035736号-3

    友情链接:一览网  江苏景威控股集团有限公司