Joy Li
Joy Li

Reputation: 47

How to undo "go mod init"

The version of Go I'm using is

go version
go version go1.15.6 darwin/amd64

I did go mod init example.com/m under my folder /***.com/m/ Now I would like to do go mod init ***.com/m, it shows as

go.mod already exists

How could I clean up the go.mod which is unwanted?

Upvotes: 2

Views: 9312

Answers (1)

thwd
thwd

Reputation: 156

The go mod init command creates the file go.mod. Delete the file to undo the action. Use del go.mod on Windows and rm go.mod on other systems.

Upvotes: 14

Related Questions