This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 数组 | |
```go | |
slice := [...]int{1, 2, 3, 4, 5} | |
for _, v := range slice { | |
v = 0 | |
fmt.Println(v) | |
// Output: 0 | |
} | |
fmt.Println(slice) | |
// Output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 切片 | |
```go | |
slice := []int{1,2,3,4,5} | |
newSlice := slice[i:j:k] | |
``` | |
- newSlice长度:j-i | |
- newSlice容量:k-i | |
```go | |
slice := []int{1,2,3,4,5} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Go语言源码目录结构 | |
```shell | |
$ go version | |
$ go1.12.1 darwin/amd64 | |
``` | |
├──api:目录,包含所有API列表,方便IDE使用 | |
├──bin:一些Go的二进制命令文件 | |
├──doc:目录,Go语言的各种文档,官网上有的,这里基本会有,这也就是为什么说可以本地搭建“官网”。这里面有不少其他资源,比如gopher图标之类的 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Vue Native | |
你是 React Native 的粉丝吗?就像 React Native 一样,Vue Native 框架允许你使用 JavaScript 来构建跨平台的原生移动应用程序。 | |
[地址](https://vue-native.io/) | |
## Vue Autosuggest | |
一个很棒的 Vue.js 自动提示组件。 | |
[地址](https://github.com/Educents/vue-autosuggest) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[新手可能会踩的 50 个坑](https://wuyin.io/2018/03/07/50-shades-of-golang-traps-gotchas-mistakes/) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- govendor init: 初始化govendor 配置文件 | |
- govendor list: 查看当前项目依赖包列表 | |
- 左英文字母表示当前包 | |
 | |
- [koa-bodyparser](https://github.com/koajs/bodyparser) | |
- [koa-views](https://github.com/queckezz/koa-views) | |
- [koa-static](https://github.com/koajs/static) | |
- [koa-session](https://github.com/koajs/session) | |
- [koa-jwt](https://github.com/koajs/jwt) | |
- [koa-helmet](https://github.com/venables/koa-helmet) | |
- [koa-compress](https://github.com/koajs/compress) | |
- [koa-logger](https://github.com/koajs/logger) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## $type | |
| Double |1| | |
|-|-| | |
| String |2| | |
| Object |3| | |
| Array |4| | |
|Binary data|5| | |
| Undefined |6| | |
|Object id|7| | |
| Boolean |8| |