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. java的bio和nio写入及读取txt文件

    一.bio的写入及读取 1.采用bio之BufferedWriter 写入文件 public static void main(String[] args) throws IOException { ...

  2. 关于导入Eclips Web项目报错的解决方案

    1.是一定要有耐心,耐心,耐心,重要的事情说三遍.针对问题一 一破解,一步一步来,不要放弃. 2.其实百度就好了他们有报错的各种问题及解决方案 ,包括导入项目web.xml报错,js文件,jsp文件报 ...

  3. DevOps到底是什么意思?

    目录 一.方法论 二.DevOps的起源 三.DevOps到底是什么 四.DevOps的发展现状 五.DevOps与虚拟化.容器.微服务 一.方法论 提到DevOps这个词,我相信很多人一定不会陌生. ...

  4. mit6.830 - lab1 - 存储模型 - 题解

    1.Intro github : https://github.com/CreatorsStack/CreatorDB lab1实现数据库基本的存储逻辑结构,具体包括:Tuple,TupleDesc, ...

  5. 2020腾讯犀牛鸟网络安全T-Star高校挑战赛writeup

    签到 浏览器禁用js,在www目录下有 key 命令执行基础 使用 | 可以执行其他命令,在 ../目录下有 key.php cat 一下读出来 你能爆破吗 一开始随便输了个账号的时候不是这个页面,抓 ...

  6. 合并函数Combiner.Combine…(Power Query 之 M 语言)

    按相同分隔符合并: =Combiner.CombineTextByDelimiter("分隔符", 引号字符) 分隔符 直接输入 特殊符号 制表符:#(tab) 回车:#(cr) ...

  7. c++模板类的使用,编译的问题

    1,模板类编译的问题 前两天在写代码时,把模板类的声明和分开放在两个文件中了,类似于下面这样: stack.hpp: #ifndef _STACK_HPP #define _STACK_HPP tem ...

  8. CF1104A Splitting into digits 题解

    Content 给定一个数字 \(n\),试将这个数分成若干个数,使得这些数都相等,输出任意一个方案均可. 数据范围:\(1\leqslant n\leqslant 1000\). Solution ...

  9. CF701A Cards 题解

    Content 有一个长度为 \(n\) 的数组 \(a_1,a_2,a_3,...,a_n\),试在其中找到 \(\dfrac{n}{2}\) 对数,使得每个数对的元素的和都相等. 数据范围:\(2 ...

  10. java 网络编程基础 UDP协议DatagramSocket,MulticastSocket 实现局域网聊天软件(Server + Client模式)

      开发思路: 服务端两个Socket: UDP的DatagramSocket接收客户端消息. 广播multicastSocket 发送广播消息 客户端一个Socket: multicastSocke ...