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'的更多相关文章

  1. 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) – ...

  2. 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 ...

  3. 12C数据库ORA-40365: The SYS user cannot be locked while the password file is in its current format

    [环境介绍] 系统环境:Solaris + Oracle 12CR2   [背景描述] 基于集团数据库安全检查项,需要把sys用户锁定或者修改复杂口令整改. 在整改前已经对参数remote_login ...

  4. 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 ...

  5. 【解决了一个小问题】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中出现如下提示: ...

  6. 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的答 ...

  7. Error: parent directory is world writable but not sticky

    在本地安装pyenv的时候,出现了如下的报错: ➜ brew install pyenv ==> Downloading https://github.com/yyuu/pyenv/archiv ...

  8. C#基础精华04(文件流,文件操作,File、Directory、Path,Directory)

    文件流 FileStream  可读可写  大文件  释放 StreamReader 读取   释放 StreamWriter 写入   释放 using 中释放 File 可读可写  小文件 操作文 ...

  9. go 连接MSSQLServer数据库【遇到的坑】

    前言:项目测试需要用到mssqlserver数据库连接,遇到坑,自己爬直接上代码:       package main import ( "database/sql" " ...

随机推荐

  1. 什么是maven(一)

    转自博主--一杯凉茶 我记得在搞懂maven之前看了几次重复的maven的教学视频.不知道是自己悟性太低还是怎么滴,就是搞不清楚,现在弄清楚了,基本上入门了.写该篇博文,就是为了帮助那些和我一样对于m ...

  2. CURD系统怎么做出技术含量惊艳面试官

    在<CURD系统怎么做出技术含量--怎样引导面试>有朋友开玩笑说都用上了领域驱动了,就不叫CURD系统了吧.这里我解释一下,怕大家对DDD领域驱动设计有什么误解. DDD是为解决软件复杂性 ...

  3. 『与善仁』Appium基础 — 22、获取元素信息的操作(一)

    目录 1.获取元素文本内容 (1)text()方法 (2)get_attribute()方法 (3)综合练习 2.获取元素在屏幕上的坐标 1.获取元素文本内容 (1)text()方法 业务场景: 进入 ...

  4. 30个类手写Spring核心原理之MVC映射功能(4)

    本文节选自<Spring 5核心原理> 接下来我们来完成MVC模块的功能,应该不需要再做说明.Spring MVC的入口就是从DispatcherServlet开始的,而前面的章节中已完成 ...

  5. [BUUCTF]REVERSE——[GKCTF2020]Check_1n

    [GKCTF2020]Check_1n 附件 步骤: 例行查壳儿,32位程序,无壳儿 32位ida载入,习惯性的检索程序里的字符串,看到了一个比较有意思的字符串,但是不懂是什么解密,先不管它了 在这些 ...

  6. 日程选项卡的设置(Project)

    <Project2016 企业项目管理实践>张会斌 董方好 编著 在使用任何一个软件之前,都有一些默认的东东要改,比如在Excel里有人不待见单元格里的0,一定要设置成不显示零值:在Wor ...

  7. 自动造数据利器,Faker 了解一下?

    1. 背景 在软件需求.开发.测试过程中,有时候需要使用一些测试数据,针对这种情况,我们一般要么使用已有的系统数据,要么需要手动制造一些数据.由于现在的业务系统数据多种多样,千变万化.在手动制造数据的 ...

  8. java 图形化小工具Abstract Window Toolit 常用组件

    基本组件 Button: 按钮,可接受单击操作 Canvas: 用于绘图的画布 Checkbox: 复选框组(也可变成单选框组件) CheckboxGroup: 用于将多个checkbox组件组合成一 ...

  9. href超级链接里加上javascript代码的,还有target问题

    href超级链接里加上javascript代码的,还有target问题 得把target="_blank"去掉才好用,在google浏览器有这个也没事,但是在Ie里有这个就不行了

  10. Python处理utf-8 添加和删除BOM头

    以下代码只处理了assic和utf8文件.其它文件编码为保险起见并未加入支持. 参数 exts 需要处理文件的扩展名 folders 需要处理的文件夹及子目录 处理目录为当前目录运行:添加bom头 p ...