go.mod file not found in current directory or any parent directory; see 'go help modules'
go的环境设置问题,执行
go env -w GO111MODULE=auto
我的环境:Windows 7, Go 1.17
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo>cd day01
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01>cd helloworld
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld>go build
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld>where go.exe
D:\Apps\Go\bin\go.exe
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld>go.exe build
go: go.mod file not found in current directory or any parent directory; see 'go help modules'
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld>go env -w GO111MODULE=auto
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld>go build
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld>go version
go version go1.17 windows/amd64
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld>dir
驱动器 D 中的卷没有标签。
卷的序列号是 C61D-1F2E
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld 的目录
2021/09/06 21:52 <DIR> .
2021/09/06 21:52 <DIR> ..
2021/09/06 21:52 1,925,120 helloworld.exe
2021/09/06 21:41 79 main.go
2 个文件 1,925,199 字节
2 个目录 71,544,717,312 可用字节
D:\Apps\GOPATH\src\code.oldboyedu.com\studygo\day01\helloworld>helloworld.exe
Hello World!
go.mod file not found in current directory or any parent directory; see 'go help modules'的更多相关文章
- Understanding go.sum and go.mod file in Go
https://golangbyexample.com/go-mod-sum-module/ Understanding go.sum and go.mod file in Go (Golang) – ...
- Docker: adding a file from a parent directory
17down votefavorite 4 In my Dockerfile I've got : ADD ../../myapp.war /opt/tomcat7/webapps/ That fil ...
- 12C数据库ORA-40365: The SYS user cannot be locked while the password file is in its current format
[环境介绍] 系统环境:Solaris + Oracle 12CR2 [背景描述] 基于集团数据库安全检查项,需要把sys用户锁定或者修改复杂口令整改. 在整改前已经对参数remote_login ...
- The directory '/home/stone/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If execu
使用sudo pip install ......的时候出现下面一段黄色的代码: The directory '/home/stone/.cache/pip/http' or its parent d ...
- 【解决了一个小问题】golang中引用一个路径较长的库,导致goland中出现"module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v2"
在项目中的go.mod文件中有这样一句: require ( github.com/xxx-devops/xx1/sdk/go v2.2.3 ) 项目的编译没有问题,但是goland中出现如下提示: ...
- mac brew 安装php扩展报错:parent directory is world writable but not sticky
$ brew install php70-mcrypt 报错: Error: parent directory is world writable but not sticky 搜索到github的答 ...
- Error: parent directory is world writable but not sticky
在本地安装pyenv的时候,出现了如下的报错: ➜ brew install pyenv ==> Downloading https://github.com/yyuu/pyenv/archiv ...
- C#基础精华04(文件流,文件操作,File、Directory、Path,Directory)
文件流 FileStream 可读可写 大文件 释放 StreamReader 读取 释放 StreamWriter 写入 释放 using 中释放 File 可读可写 小文件 操作文 ...
- go 连接MSSQLServer数据库【遇到的坑】
前言:项目测试需要用到mssqlserver数据库连接,遇到坑,自己爬直接上代码: package main import ( "database/sql" " ...
随机推荐
- 使用JSP实现输出
一.在JSP页面添加java代码,实现输出,java代码写在<% %>中. 代码示例1: <body> <!-- HTML注释 --> <%-- JSP注释 ...
- 【C/C++】例题5-4 反片语/算法竞赛入门经典/C++与STL入门/映射:map
本题是映射:map的例题. map:键值对. [题目] 输入一些单词,找出所有满足如下条件的单词:该单词不能通过字母重排,得到输入文本中的另外一个单词. 在判断是否满足条件时,字母不分大小写,但在输出 ...
- 文本处理的命令,三剑客之sed
文本处理的命令 1.sort命令 "用于将文件内容加以排序" 参数: -n :按照数值的大小排序 -r :以相反的顺序来排序 -k :以某列进行排序 -t :指定分隔符,默认是以空 ...
- CF1506C Double-ended Strings 题解
Content 有两个字符串 \(a,b\).我们每次操作可以将两个字符串中的一个字符串的最前面一个字符或这最后面一个字符删去(可以将某个字符串通过若干次操作变为空串).求需要多少次操作才能够使 \( ...
- LuoguB2045 晶晶赴约会 题解
Content 贝贝邀请晶晶下个星期 \(x\)(如果 \(x=7\) 表示星期日)一起去看展览,但是晶晶下个星期 \(1,3,5\) 都有课.请你判断晶晶能否同意贝贝的请求. 数据范围:\(x\in ...
- ubuntu16.04 开启ipv6支持
1)vim /etc/default/grub将GRUB_CMDLINE_LINUX中下面的这一项删除:ipv6.disable=12)执行 grub-mkconfig -o /boot/grub/ ...
- Birt报表设置自定义的值
比如数据库查出该字段的值有"no",有"yes",那么想要根据当是no是显示"未完成",当是yes时显示"已完成" 可以 ...
- react中使用Input表单双向绑定方法
input react 表单 input 密码框在谷歌浏览器下 会有黄色填充 官网的不太用,这个比较好用 type="password" autoComplete="ne ...
- JAVA使用经纬度通过腾讯地图API获取详细地址
官方文档:https://lbs.qq.com/service/webService/webServiceGuide/webServiceGcoder package com.weixin.map; ...
- vc++ 调用winapi调节屏幕亮度(增加win7代码demo)
1.关于 代码是通过测试的,测试环境: win7 + MFC 为什么要发在这里? 区别于上一篇随笔. MD排版更顺眼 demo 会放到 这里 更正了上一篇随笔中的代码错误 2.头文件 #include ...