当前位置: 首页 > news >正文

go错误集(持续更新)

1.提示以下报错

Build Error: go build -o c:\Users\Administrator\Desktop__debug_bin2343731882.exe -gcflags all=-N -l .
go: go.mod file not found in current directory or any parent directory; see ‘go help modules’ (exit status 1)
在这里插入图片描述

解决办法:

go env -w GO111MODULE=auto

2.安装模块失败

dlv: failed to install dlv(github.com/go-delve/delve/cmd/dlv@latest): Error
解决办法:

在这里插入图片描述

配置 Goproxy 环境变量

Bash (Linux or macOS)

export GOPROXY=https://mirrors.aliyun.com/goproxy/,direct

PowerShell (Windows)

$env:GOPROXY = "https://mirrors.aliyun.com/goproxy/,direct"

启用 Go Modules 功能

go env -w GO111MODULE=on

使配置长久生效 (推荐)
上面的配置步骤只会当次终端内生效,如何长久生效呢,这样就不用每次都去配置环境变量了。

Mac/Linux

设置你的 bash 环境变量

echo "export GOPROXY=https://mirrors.aliyun.com/goproxy/,direct" >> ~/.profile && source ~/.profile

如果你的终端是 zsh,使用以下命令

echo "export GOPROXY=https://mirrors.aliyun.com/goproxy/,direct" >> ~/.zshrc && source ~/.zshrc

Windows

1. 右键 我的电脑 -> 属性 -> 高级系统设置 -> 环境变量
2. 在 “[你的用户名]的用户变量” 中点击 ”新建“ 按钮
3. 在 “变量名” 输入框并新增 “GOPROXY”
4. 在对应的 “变量值” 输入框中新增 “https://mirrors.aliyun.com/goproxy/,direct”
5. 最后点击 “确定” 按钮保存设置

3.待统计

各位大佬有错误集也可同步或在评论区中评论。

http://www.lryc.cn/news/114444.html

相关文章:

  • 【Docker】Docker中network的概要、常用命令、网络模式以及底层ip和容器映射变化的详细讲解
  • arcgis栅格数据之最佳路径分析
  • docker服务器部署Django
  • SpringBoot集成百度人脸识别实现登陆注册功能Demo(二)
  • FPGA纯verilog实现 LZMA 数据压缩,提供工程源码和技术支持
  • C++实现一个链栈
  • Vue电商项目--VUE插件的使用及原理
  • 2.部署kubernetes的组件
  • 后端开发4.Elasticsearch的搭建
  • 嵌入式该往哪个方向发展?
  • 非凸科技受邀参加中科大线上量化分享
  • Linux 命令之 - chown(改变文件拥有者及所属组)
  • 【基于openharmony的多路摄像头功能:USB设备插拔检测】
  • uni-app:实现数字文本框,以及左右加减按钮
  • 跨平台开发框架Qt:面向对象、丰富API
  • An unexpected error has occurred. Conda has prepared the above report
  • 考研C语言进阶题库——更新6-10题
  • 汽车BOOTLOADER开发经历
  • 适配器模式(C++)
  • HTTP连接之出现400 Bad Request分析
  • 后端开发, 接口幂等性是什么意思
  • k8s手动发布镜像的方法
  • 十二、ESP32控制步进电机
  • 利用openTCS实现车辆调度系统(六)openTCS订单的使用
  • 第一天 什么是CSRF ?
  • 知识图谱推荐系统研究综述
  • 基于Centos7的Nginx源码安装
  • Ubuntu 20.04 安装 Stable Diffusionn
  • vue name命名错误 Do not use built-in or reserved HTML elements as component
  • 知识付费系统开发:构建高效智能的付费内容平台