当前位置:网站首页>golang hello 安装环境异常【已解决】
golang hello 安装环境异常【已解决】
2022-06-27 04:19:00 【JavaPub-rodert】
异常信息
初次安装go环境-hello
go: go.mod file not found in current directory or any parent directory; see 'go help modules'

原因分析:
go 的环境配置问题。与 golang 的包管理有关。
解决方案:
如果你是 Windows 系统,快捷键 “Win+R”,输入 cmd,打开终端。输入:
go env -w GO111MODULE=auto
解释:
GO111MODULE 是 Go 1.11 引入的新版模块管理方式。
GO111MODULE 环境变量用于开启或关闭 Go 语言中的模块支持,它有 off、on、auto 三个可选值,默认为 auto。
GO111MODULE=off
无模块支持,go 会从 $GOPATH 文件夹和 vendor 目录中寻找依赖项。
GO111MODULE=on
模块支持,go 忽略 $GOPATH 文件夹,只根据 go.mod 下载依赖。
GO111MODULE=auto
在 $GOPATH/src 外层且根目录有 go.mod 文件时,开启模块支持;否者无模块支持。
边栏推荐
- ERP需求和销售管理 金蝶
- 1.5 conda的使用
- JMeter takes the result of the previous request as the parameter of the next request
- 深潜Kotlin协程(十五):测试 Kotlin 协程
- 006 C语言基础:C存储类
- Learn crypto from Buu (Zhou Geng)
- 日志收集系统
- Network structure and model principle of convolutional neural network (CNN)
- Building lightweight target detection based on mobilenet-yolov4
- 【B站UP DR_CAN学习笔记】Kalman滤波3
猜你喜欢

Mobilenet series (4): mobilenetv3 network details

2021:Greedy Gradient Ensemble for Robust Visual Question Answering

fplan-Powerplan实例

Office VR porn, coquettish operation! The father of Microsoft hololens resigns!

Mysql database foundation: DQL data query language

JMeter takes the result of the previous request as the parameter of the next request

MySql最详细的下载教程

文旅夜游|以沉浸式视觉体验激发游客的热情
![[array]bm94 rainwater connection problem - difficult](/img/2b/1934803060d65ea9139ec489a2c5f5.png)
[array]bm94 rainwater connection problem - difficult

MATLAB | 三个趣的圆相关的数理性质可视化
随机推荐
电商产品如何在知乎上进行推广和打广告?
Facing the "industry, University and research" gap in AI talent training, how can shengteng AI enrich the black land of industrial talents?
【B站UP DR_CAN学习笔记】Kalman滤波2
MySql最详细的下载教程
014 C语言基础:C字符串
Fplan powerplan instance
高等数学(第七版)同济大学 习题1-10 个人解答
Penetration test - directory traversal vulnerability
Cvpr2021:separating skills and concepts for new visual question answering
日志收集系統
A^2=e | the solution of the equation | what exactly can this equation tell us
面对AI人才培养的“产学研”鸿沟,昇腾AI如何做厚产业人才黑土地?
math_ Number set (number set symbol) and set theory
[BJDCTF2020]The mystery of ip
Six possible challenges when practicing Devops
Cache comprehensive project - seckill architecture
fplan-Powerplan实例
[promise I] introduction of promise and key issues of hand rolling
fplan-布局
Office VR porn, coquettish operation! The father of Microsoft hololens resigns!