简体   繁体   English

Go mod tidy find 模块,但它没有到达 go.sum

[英]Go mod tidy find module but it's not getting to go.sum

i have a Revel project and i can't start it because everytime i run go mod tidy, it looks like finding module but it's not putting the found module in go.sum我有一个 Revel 项目,但我无法启动它,因为每次我运行 go mod tidy 时,它看起来像是在寻找模块,但它没有将找到的模块放入 go.sum

here's my go env这是我的 go 环境

GOENV = C:\Users\mycomp\AppData\Roaming\go\env
GOMOD = C:\Program Files\Go\src\myproject\go.mod
GOPATH = C:\Users\micha\go

go version

go version go1.18.3 windows/amd64

revel version

Revel executing: displays the Revel Framework and Go version
Revel Framework :       Unknown (1.1.0 remote master branch)
Revel Cmd       :       1.1.2   (1.1.2 remote master branch)
Revel Modules   :       Unknown (1.1.0 remote master branch)

go mod tidy

go: finding module for package github.com/PaesslerAG/jsonpath
go: finding module for package github.com/tdewolff/test
go: finding module for package github.com/PaesslerAG/gval
go: found github.com/tdewolff/test in github.com/tdewolff/test v1.0.7
go: found github.com/PaesslerAG/gval in github.com/PaesslerAG/gval v1.2.0
go: found github.com/PaesslerAG/jsonpath in github.com/PaesslerAG/jsonpath v0.1.1

go mod init myproject seem working because it create go.mod but it's just odd because it only creates this line, usually it creates a lot of modules i need go mod init myproject似乎工作,因为它创建go.mod但这很奇怪,因为它只创建这条线,通常它会创建很多我需要的模块

module myproject

go 1.18

then when i type go mod tidy , it creates empty go.sum .然后当我输入go mod tidy时,它会创建空go.sum What do i miss?我想念什么?

Cause the problem is too complex to reproduce online, i started to debug and reinstall my Go from scractch, between solving a bug where my program can't run i tried several things that might be useful由于问题太复杂而无法在线重现,我开始从头开始调试并重新安装我的 Go,在解决程序无法运行的错误之间,我尝试了一些可能有用的方法

  1. after Go 1.15 or 1.17, my Go project can't run properly, so i put it in C:\Program Files\Go\src\<project_name>在 Go 1.15 或 1.17 之后,我的 Go 项目无法正常运行,所以我把它放在C:\Program Files\Go\src\<project_name>
  2. The problem that i have is in GOPATH (usually in C:\Users\<comp_name>\go ) don't have src folder, that makes it found downloaded module but can't seem to put it in go.mod inside my project我遇到的问题是在GOPATH中(通常在C:\Users\<comp_name>\go中)没有src文件夹,这使得它找到了下载的模块,但似乎无法将它放在我的项目中的go.mod

So in the end i reinstall all my Go and Revel.所以最后我重新安装了我所有的 Go 和 Revel。 Here's how to delete all your associated Go to really really delete all your files这是删除所有关联的 Go 以真正删除所有文件的方法

  1. Delete Go Folder in C:\Program Files\Go\删除Go C:\Program Files\Go\中的 Go 文件夹
  2. Delete go folder in C:\Users\<comp_name>\go删除go C:\Users\<comp_name>\go中的 go 文件夹
  3. View all hidden files and delete folder go-build in C:\Users\<comp_name>\AppData\Local查看所有隐藏文件并删除C:\Users\<comp_name>\AppData\Local中的文件夹go-build
  4. View all hidden files and delete folder go if any in C:\Users\micha\AppData\Roaming查看所有隐藏文件并删除go文件夹(如果有)在C:\Users\micha\AppData\Roaming

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM