摘要: ```cmd [root@foundation38 demo]# git push -u origin master Username for 'https://github.com': xuefeilong Password for 'https://xuefeilong@github.com': To https://github.com/xuefeilong/test.git ! [reje 阅读全文
posted @ 2019-11-26 17:40 输诚 阅读(1550) 评论(0) 推荐(0) 编辑
摘要: gin使用logrus main.go log文件: 阅读全文
posted @ 2019-08-28 18:35 输诚 阅读(3049) 评论(0) 推荐(0) 编辑
摘要: golang中如何监控多个goroute协程是否执行完成 go package main import ( "fmt" ) // 将intchan管道中的素数插入到管道resultchan中,协程完成关闭时在exitchan中记录一次 func calc(intchan, resultchan, e 阅读全文
posted @ 2019-08-25 20:55 输诚 阅读(2060) 评论(0) 推荐(0) 编辑
摘要: golang中管道(chan)的一些用法 golang中的管道可以用于各个goroute方法的数据交互,管道有一些方法: go package main import ( "fmt" ) func main() { var ( IntChan = make(chan int, 1000) //Res 阅读全文
posted @ 2019-08-25 20:24 输诚 阅读(1517) 评论(0) 推荐(0) 编辑
摘要: GOROOT&GOPATH设置 阅读全文
posted @ 2019-08-25 09:32 输诚 阅读(2367) 评论(0) 推荐(0) 编辑
摘要: 1、命令行中输入以下命令,确保命令暂时可以使用,命令行执行完不要关闭终端; 2、修改.bash_profile文件 终端输入 打开文件,根据自己情况做出相应的修改 3、使修改生效 阅读全文
posted @ 2019-08-25 09:13 输诚 阅读(587) 评论(0) 推荐(0) 编辑
摘要: ```go package main import ( "fmt" "io/ioutil" ) func main() { inputFile := "/golang/code/test1/src/day9/文件读写/input1" output := "/golang/code/test1/src/day9/文件读写/output" reader, err := ioutil.ReadFile( 阅读全文
posted @ 2019-08-24 21:58 输诚 阅读(1417) 评论(0) 推荐(0) 编辑
摘要: ```go func main() { a := []string{"Hello1", "Hello2", "Hello3"} fmt.Println(a) // [Hello1 Hello2 Hello3] a = append(a[:0], a[1:]...) fmt.Println(a) // [Hello2 Hello3] } ``` 阅读全文
posted @ 2019-08-23 18:10 输诚 阅读(7709) 评论(0) 推荐(0) 编辑
摘要: ```golang package main import ( "fmt" "math/rand" "time" ) func main() { rand.Seed(time.Now().UnixNano()) // 创建一个(随机库池,保证每次随机的依据都不一样,不然每次随机出来的都是同一个值) 阅读全文
posted @ 2019-08-21 20:26 输诚 阅读(403) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2018.cnblogs.com/blog/1635229/201908/1635229-20190813162910610-854473915.png) ![](https://img2018.cnblogs.com/blog/1635229/201908/1635229-20190813162918275-813310748.png) 阅读全文
posted @ 2019-08-13 16:29 输诚 阅读(3810) 评论(0) 推荐(0) 编辑