
golang
导演我躺哪儿
这个作者很懒,什么都没留下…
展开
-
fabric源码调试一:Version of Delve is too old for this version of Go
1、goland版本2、go版本go version go1.14.9 linux/amd643、在debug的时候会出现如上提示,Delve版本太低无法DebugVersion of Delve is too old for this version of Go (maximum supported version 1.13, suppress this error with --check-go-version=false)4、安装dlv方式一:(1)安装dlvwang@wang:原创 2020-09-15 11:32:00 · 2026 阅读 · 1 评论 -
用docker部署go简单应用
1.首先使用go语言实现基本http服务使用echo标准库实现8080端口输出helloworld的服务。安装echoimport ( "github.com/labstack/echo" "log" "net/http")func main() { e := echo.New() e.GET("/", handlerindex) log...转载 2019-10-28 17:30:03 · 754 阅读 · 0 评论 -
go安装echo框架
在执行 go get -u github.com/labstack/echo的时候报错如下:wang@wang:~$ go get github.com/labstack/echopackage golang.org/x/sys/unix: unrecognized import path "golang.org/x/sys/unix" (https fetch: Get https://go...原创 2019-10-25 17:48:36 · 752 阅读 · 0 评论 -
ubuntu下安装goland以及护眼、主题、字体等设置
1、下载goland选择2018.2.1之前的版本,否则后面授权服务器不能使用。https://www.jetbrains.com/go/download/previous.html2、放到home目录然后进行解压wang@wang:~$ tar -zxvf goland-2018.1.7.tar.gz 3、进入bin目录执行wang@wang:~/GoLand-2018.1.7/bi...原创 2019-02-19 10:15:26 · 1318 阅读 · 0 评论 -
golang中gRpc的安装&goland 插件protobuf support
golang安装gRpc2017年09月29日 14:00:56 钟声响起 阅读数:2517更多个人分类: 新技术研究版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.youkuaiyun.com/cjj198561/article/details/78133193安装官方安装命令:go get google.golang.org/grpc是安装不起的,会报:pac...原创 2018-09-22 14:59:15 · 16277 阅读 · 4 评论 -
GoLang协程
目前,WebServer几种主流的并发模型: 多线程,每个线程一次处理一个请求,在当前请求处理完成之前不会接收其它请求;但在高并发环境下,多线程的开销比较大; 基于回调的异步IO,如Nginx服务器使用的epoll模型,这种模式通过事件驱动的方式使用异步IO,使服务器持续运转,但人的思维模式是串行的,大量回调函数会把流程分割,对于问题本身的反应不够自然; 协程,不需要抢占式调度,可以有效...转载 2018-10-10 13:56:17 · 1080 阅读 · 0 评论 -
Golang笔记-接口的实现
package mainimport "fmt"type run interface { jump()}type Dog interface { eat() sleep() run}type xh struct { run}func (x xh) eat() { fmt.Println("eat")}func (x xh) sleep() { fmt.Print...原创 2018-10-19 14:52:05 · 169 阅读 · 0 评论 -
Golang笔记-大小写作用范围
验证作用范围所使用的目录结构:其中main.go内容如下:package mainimport ( "encoding/json" "fmt" "practice/mulu1" "practice/mulu2" "practice/mulu4")//1.即使mulu1下的Plus是首字母大写,这里也要导原创 2018-11-08 18:45:36 · 1523 阅读 · 0 评论 -
goland 的viper插件
非原创,做一个知识点的传播者~~因为fabric里面读取配置文件等使用的是viper,这里也学习一下,做个使用笔记。go get github.com/spf13/viper其中main.go内容:package mainimport ( "fmt" "os" "path/filepath" "strings" "gith转载 2018-11-14 11:15:48 · 3271 阅读 · 0 评论 -
Golang--选择语句&fallthrough
switch sExpr {case expr1: some instructionscase expr2: some other instructionscase expr3: some other instructionsdefault: other code}sExpr和expr1、expr2、expr3的类型必须一致。Go的switch非常灵活...转载 2018-11-22 18:16:59 · 418 阅读 · 0 评论 -
Golang:Cobra的安装和简单使用总结
Cobra的安装就本人安装Cobra,解决两个报错即可: 第一个:使用命令 go get -v github.com/spf13/cobra/cobra 下载过程中,会出提示如下错误:Fetching https://golang.org/x/sys/unix?go-get=1https fetch failed: Get https://golang.org/x/sys/unix?g...原创 2018-09-12 13:41:56 · 3661 阅读 · 0 评论