答: tab 空格数设置为4,加入以下五行到~/.vimrc即可 set smartindent set tabstop= set shiftwidth= set expandtab set softtabstop= 执行以下命令即可写入: echo -e 'set smartindent\nset tabstop=4\nset shiftwidth=4\nset expandtab\nset softtabstop=4\n' >>~/.vimrc…
目录 例子 原因 如何去实现 例子 我们时常会写一些interface,例如: type A interface{ Print() } type B struct { } func (b *B) Print() { fmt.Println("Here is *B") } 赋值的时候: var a A a = &B{} 诶,这样看视乎没什么问题,但是我们没有办法避免使用数组,然后顺手就写了这样的代码 var aa []A aa = make([]*B, 10) 好的,现在翻车了,…