![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go
文章平均质量分 66
一旦9912
这个作者很懒,什么都没留下…
展开
-
环境变量PATH与go包管理
简介 之前写mapreduce用的是go1.9,最近写GFS要用go1.16,出了很多毛病 环境变量 环境变量分为用户环境变量和全局环境变量,首先要知道基本概念: https://blog.csdn.net/Zou__Sheng/article/details/100146197 简单概括就是: etc/profile 全局环境设置,登录时会读取 ~/.profile(debian)或~/.bash_profile 用户环境设置,相应用户登录时会读取 /etc/bashrc 为每一个运行bash shell原创 2021-06-03 14:48:06 · 318 阅读 · 0 评论 -
浅谈 go slice & string
浅谈 Slice array array 是固定大小的,256 is part of the type var buffer [256]byte In go, the most common purpose for array is to hold storage for a slice Slice basics desc from the official blog : A slice is a data structure describing a contiguous section of an原创 2021-05-11 22:02:52 · 144 阅读 · 0 评论 -
初探go多线程 | goroutine
Tutorial create a new goroutine go f(x,y,z) channels Channels are a typed conduit through which you can send and receive values with the channel operator, <- usually, will use channels to communicate between multiple threads //create channel ch := mak原创 2021-05-01 12:43:25 · 108 阅读 · 1 评论 -
go convert byte to string
引用自 https://stackoverflow.com/questions/31220421/convert-a-byte-to-a-string-in-go 需求 bytes := [4]byte{1,2,3,4} str := convert(bytes) //str == "1,2,3,4" 解答 func convert( b []byte ) string { s := make([]string,len(b)) for i := range b { s[i]转载 2021-05-01 09:56:29 · 338 阅读 · 0 评论 -
go语言入门小结
Demo 1.Hello World package main //注意空行 import "fmt" //注意空行 func main(){ fmt.Println("Hello,world") } 2.Module Import 国内可能无法访问go包代理网站,换个镜像 go env -w GOPROXY=https://goproxy.cn 代码如下 package main import "fmt" import "rsc.io/quote" func main(){ fmt.Prin原创 2021-01-26 11:49:43 · 200 阅读 · 0 评论