摘要: 01、webpack官网找loader配置 https://webpack.js.org >DOCUMENTATION >Loaders下面可以找到各种loader配置 02、处理css文件 npm install --save-dev css-loader style-loader 配置webpa 阅读全文
posted @ 2020-10-20 22:43 TBBS 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 01、安装node.js 02、新建工程目录Webpack 03、初始化node工程 npm init 根据提示,输入工程信息 04、本地安装webpack(可使用更新的版本) npm install webpack@5.1.0 --save-dev 05、新建子目录 dist 编译后文件所在路径 阅读全文
posted @ 2020-10-14 22:10 TBBS 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 01、使用...打散参数 1 package main 2 3 import ( 4 "fmt" 5 ) 6 7 func main() { 8 s := []byte("hello ")//强转 9 s = append(s, "world"...)//向byte切片追加,...表示将字符串打散成 阅读全文
posted @ 2020-05-04 11:30 TBBS 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 01、值类型和引用类型 GO只有slice、map、chan 3种引用类型,其它都是值类型 02、slice引用拷贝 1 package main 2 3 import ( 4 "fmt" 5 ) 6 7 func appendSlice(s []int) { 8 s[0] = 10//成功修改ma 阅读全文
posted @ 2020-05-02 22:01 TBBS 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 01、按照内存对齐,重新计算结构体长度 1 const ( 2 maxAlign = 8 //按照8个byte进行内存对齐 3 hchanSize = unsafe.Sizeof(hchan{}) + uintptr(-int(unsafe.Sizeof(hchan{}))&(maxAlign-1) 阅读全文
posted @ 2020-05-02 21:07 TBBS 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 01、使用chan控制程序结束 package main import "fmt" func main() { c := make(chan bool) go func() { fmt.Println("hello") c <- true }() <-c } 02、遍历chan 1 package 阅读全文
posted @ 2020-05-02 11:40 TBBS 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 01、反射字段和方法 1 package main 2 3 import ( 4 "fmt" 5 "reflect" 6 ) 7 8 type Name struct { 9 name string 10 age int 11 } 12 13 func (n Name) Print() { 14 f 阅读全文
posted @ 2020-05-02 09:21 TBBS 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 01、Pointer类型 unsafe包下,有定义type Pointer *ArbitraryType(任意类型指针),可绕过GO的类型限制,type ArbitraryType int 任何类型的指针值都可以转换为Pointer。 Pointer可以转换为任何类型的指针值。 uintptr可以转 阅读全文
posted @ 2020-04-28 20:56 TBBS 阅读(1325) 评论(0) 推荐(0) 编辑
摘要: 01、尽量只在未推送到公共仓库的提交上执行变基。 02、变基风险 a)远程仓库 & 本地开发 b)远程有新的推送 & 本地更新合并 c)远程通过变基,放弃C6提交并通过git push --force推送 d)本地更新&合并 尴尬1:有2个提交的作者、日期、日志完全一样(C4和C4') 尴尬2:将公 阅读全文
posted @ 2020-04-16 08:26 TBBS 阅读(903) 评论(0) 推荐(0) 编辑
摘要: 01、3个分支的变基 02、将client基于server的变基,重放到master分支 $ git rebase --onto master server client 03、合并client分支 $ git checkout master $ git merge client 04、直接将特性分 阅读全文
posted @ 2020-04-15 08:39 TBBS 阅读(172) 评论(0) 推荐(0) 编辑