简体   繁体   中英

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?

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.

follow the nice instructions here

https://golang.org/ref/mod#go-mod-edit

and read the rest of that doc, it's pretty good

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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