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

2.1k views Asked by At

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

here's my go env

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

module myproject

go 1.18

then when i type go mod tidy, it creates empty go.sum. What do i miss ?

1

There are 1 answers

0
Michael Halim On BEST ANSWER

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

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

So in the end i reinstall all my Go and Revel. Here's how to delete all your associated Go to really really delete all your files

  1. Delete Go Folder in C:\Program Files\Go\
  2. Delete go folder in C:\Users\<comp_name>\go
  3. View all hidden files and delete folder go-build in C:\Users\<comp_name>\AppData\Local
  4. View all hidden files and delete folder go if any in C:\Users\micha\AppData\Roaming