美文网首页
2021-01-04 学习GO 第一天

2021-01-04 学习GO 第一天

作者: 懂事长qingzZ | 来源:发表于2021-01-04 18:35 被阅读0次

第一步:安装VsCode,配置环境路径 :测试go

https://www.jianshu.com/p/67dcf4e828e9

Mac下环境路径一个位置, 真正的工程路径是一个位置, 去.bash_profile 不显示~/.bash_profile

使用快捷键显示隐藏文件  command + shit + .  

第二部 在VsCode中搭建Go开发环境,手把手教你配置

https://blog.csdn.net/adolphkevin/article/details/90274378

不配置的话代码运行正常,会出现创建新文件夹, 一直import 报错

第二步 在vscode安装GO插件,会出现下面的问题

1.  go项目开发 mkdir -p $GOPATH/src/golang.org/x

mkdir: /src/golang.org/x: Read-only file system

解决

Mac根目录下创建目录出现Read-only file system的问题

https://blog.csdn.net/starry0819/article/details/102582389

========================================================================================================================

2.

macOS Catalina下安装MongoDB遇到的各种坑

https://blog.csdn.net/weixin_45121701/article/details/104931035

3.

Installing github.com/mdempsky/gocode FAILED

{

 "killed": false,

 "code": 1,

 "signal": null,

 "cmd": "/usr/local/go/bin/go get -v github.com/mdempsky/gocode",

 "stdout": "",

 "stderr": "go get github.com/mdempsky/gocode: module github.com/mdempsky/gocode: Get \"https://proxy.golang.org/github.com/mdempsky/gocode/@v/list\": dial tcp 172.217.160.113:443: i/o timeout\n"

}

Installing github.com/uudashr/gopkgs/v2/cmd/gopkgs FAILED

{

 "killed": false,

 "code": 1,

 "signal": null,

 "cmd": "/usr/local/go/bin/go get -v github.com/uudashr/gopkgs/v2/cmd/gopkgs",

 "stdout": "",

 "stderr": "go get github.com/uudashr/gopkgs/v2/cmd/gopkgs: module github.com/uudashr/gopkgs/v2/cmd/gopkgs: Get \"https://proxy.golang.org/github.com/uudashr/gopkgs/v2/cmd/gopkgs/@v/list\": dial tcp 172.217.160.113:443: i/o timeout\n"

}

Installing github.com/ramya-rao-a/go-outline FAILED

{

 "killed": false,

 "code": 1,

 "signal": null,

 "cmd": "/usr/local/go/bin/go get -v github.com/ramya-rao-a/go-outline",

 "stdout": "",

 "stderr": "go get github.com/ramya-rao-a/go-outline: module github.com/ramya-rao-a/go-outline: Get \"https://proxy.golang.org/github.com/ramya-rao-a/go-outline/@v/list\": dial tcp 172.217.160.113:443: i/o timeout\n"

}

Installing github.com/go-delve/delve/cmd/dlv FAILED

{

 "killed": false,

 "code": 1,

 "signal": null,

 "cmd": "/usr/local/go/bin/go get -v github.com/go-delve/delve/cmd/dlv",

 "stdout": "",

 "stderr": "go get github.com/go-delve/delve/cmd/dlv: module github.com/go-delve/delve/cmd/dlv: Get \"https://proxy.golang.org/github.com/go-delve/delve/cmd/dlv/@v/list\": dial tcp 172.217.160.113:443: i/o timeout\n"

}

Installing github.com/stamblerre/gocode FAILED

{

 "killed": false,

 "code": 1,

 "signal": null,

 "cmd": "/usr/local/go/bin/go get -v -d github.com/stamblerre/gocode",

 "stdout": "",

 "stderr": "go get github.com/stamblerre/gocode: module github.com/stamblerre/gocode: Get \"https://proxy.golang.org/github.com/stamblerre/gocode/@v/list\": dial tcp 172.217.160.113:443: i/o timeout\n"

}

Installing github.com/rogpeppe/godef FAILED

{

 "killed": false,

 "code": 1,

 "signal": null,

 "cmd": "/usr/local/go/bin/go get -v github.com/rogpeppe/godef",

 "stdout": "",

 "stderr": "go get github.com/rogpeppe/godef: module github.com/rogpeppe/godef: Get \"https://proxy.golang.org/github.com/rogpeppe/godef/@v/list\": dial tcp 172.217.160.113:443: i/o timeout\n"

}

Installing github.com/sqs/goreturns FAILED

{

 "killed": false,

 "code": 1,

 "signal": null,

 "cmd": "/usr/local/go/bin/go get -v github.com/sqs/goreturns",

 "stdout": "",

 "stderr": "go get github.com/sqs/goreturns: module github.com/sqs/goreturns: Get \"https://proxy.golang.org/github.com/sqs/goreturns/@v/list\": dial tcp 172.217.160.113:443: i/o timeout\n"

}

Installing golang.org/x/lint/golint FAILED

{

 "killed": false,

 "code": 1,

 "signal": null,

 "cmd": "/usr/local/go/bin/go get -v golang.org/x/lint/golint",

 "stdout": "",

 "stderr": "go get golang.org/x/lint/golint: module golang.org/x/lint/golint: Get \"https://proxy.golang.org/golang.org/x/lint/golint/@v/list\": dial tcp 172.217.160.113:443: i/o timeout\n"

}

8 tools failed to install.

gocode: failed to install gocode(github.com/mdempsky/gocode): Error: Command failed: /usr/local/go/bin/go get -v github.com/mdempsky/gocode

go get github.com/mdempsky/gocode: module github.com/mdempsky/gocode: Get "https://proxy.golang.org/github.com/mdempsky/gocode/@v/list": dial tcp 172.217.160.113:443: i/o timeout

 no output 

gopkgs: failed to install gopkgs(github.com/uudashr/gopkgs/v2/cmd/gopkgs): Error: Command failed: /usr/local/go/bin/go get -v github.com/uudashr/gopkgs/v2/cmd/gopkgs

go get github.com/uudashr/gopkgs/v2/cmd/gopkgs: module github.com/uudashr/gopkgs/v2/cmd/gopkgs: Get "https://proxy.golang.org/github.com/uudashr/gopkgs/v2/cmd/gopkgs/@v/list": dial tcp 172.217.160.113:443: i/o timeout

 no output 

go-outline: failed to install go-outline(github.com/ramya-rao-a/go-outline): Error: Command failed: /usr/local/go/bin/go get -v github.com/ramya-rao-a/go-outline

go get github.com/ramya-rao-a/go-outline: module github.com/ramya-rao-a/go-outline: Get "https://proxy.golang.org/github.com/ramya-rao-a/go-outline/@v/list": dial tcp 172.217.160.113:443: i/o timeout

 no output 

dlv: failed to install dlv(github.com/go-delve/delve/cmd/dlv): Error: Command failed: /usr/local/go/bin/go get -v github.com/go-delve/delve/cmd/dlv

go get github.com/go-delve/delve/cmd/dlv: module github.com/go-delve/delve/cmd/dlv: Get "https://proxy.golang.org/github.com/go-delve/delve/cmd/dlv/@v/list": dial tcp 172.217.160.113:443: i/o timeout

 no output 

gocode-gomod: failed to install gocode-gomod(github.com/stamblerre/gocode): Error: Command failed: /usr/local/go/bin/go get -v -d github.com/stamblerre/gocode

go get github.com/stamblerre/gocode: module github.com/stamblerre/gocode: Get "https://proxy.golang.org/github.com/stamblerre/gocode/@v/list": dial tcp 172.217.160.113:443: i/o timeout

 no output 

godef: failed to install godef(github.com/rogpeppe/godef): Error: Command failed: /usr/local/go/bin/go get -v github.com/rogpeppe/godef

go get github.com/rogpeppe/godef: module github.com/rogpeppe/godef: Get "https://proxy.golang.org/github.com/rogpeppe/godef/@v/list": dial tcp 172.217.160.113:443: i/o timeout

 no output 

goreturns: failed to install goreturns(github.com/sqs/goreturns): Error: Command failed: /usr/local/go/bin/go get -v github.com/sqs/goreturns

go get github.com/sqs/goreturns: module github.com/sqs/goreturns: Get "https://proxy.golang.org/github.com/sqs/goreturns/@v/list": dial tcp 172.217.160.113:443: i/o timeout

 no output 

golint: failed to install golint(golang.org/x/lint/golint): Error: Command failed: /usr/local/go/bin/go get -v golang.org/x/lint/golint

go get golang.org/x/lint/golint: module golang.org/x/lint/golint: Get "https://proxy.golang.org/golang.org/x/lint/golint/@v/list": dial tcp 172.217.160.113:443: i/o timeout

 no output 

解决方案:

推荐使用:一招完美解决vscode安装go插件失败问题

https://blog.csdn.net/sunnylucy1/article/details/109535565

下面手动安装 有些东西我测试时不行的

Visual Studio Code安装go插件报错解决方案

https://blog.csdn.net/dmt742055597/article/details/85865186

相关文章

  • 2021-01-04 学习GO 第一天

    第一步:安装VsCode,配置环境路径 :测试go https://www.jianshu.com/p/67dcf...

  • 俯瞰大地之美,全球首届航拍大赛

    The First Annual Aerial Photography Awards 2021-01-04 264...

  • go学习第一天

    go基础学习第一天 一.关键词 break default func interface sele...

  • Go语言开发资料收集

    【Go 边看边练 -《Go 学习笔记》】系列Go 边看边练 -《Go 学习笔记》系列(一)- 变量、常量Go 边看...

  • go语言学习-从基础到实战到源码分析

    收集的一些go语言学习资料,有go基础学习系列,go项目实战,go进阶-go源码分析,还有go的一些书籍,go的架...

  • go 基础学习

    1 go 基础go 语法基础go 官方资料如果由C ,C++ 基础, 学习go 比较容易,本文学习go ,主要是为...

  • Go 语言学习技巧和编程思维

    Go 语言学习技巧和编程思维 一、了解 Go 语言 了解 Go 语言背景 学习 Go 语言,首先要了解 Go 语言...

  • go语言学习

    基础 go的学习,感谢Go By Example、go网络编程与go语言标准库随着学习的深入,此文章持续更新......

  • Go

    文章 Go Data Structures 学习资料 Go by Example Go Web Examples ...

  • GO——学习笔记(五)

    上篇:GO——学习笔记(四) 下篇:GO——学习笔记(六) 示例代码——go_4 https://github.c...

网友评论

      本文标题:2021-01-04 学习GO 第一天

      本文链接:https://www.haomeiwen.com/subject/bqnvoktx.html