Home > Net >  Is go.mod in Go the same thing as package.json in JavaScript (node)?
Is go.mod in Go the same thing as package.json in JavaScript (node)?

Time:08-26

I am currently learning Go & it mentions using go.mod for dependency management. When using node, package.json files are used for dependency management, so is go.mod the same thing as something like npm init -y?

CodePudding user response:

yes. go mod init will create go.mod file. go mod tidy( like npn install ) will pull the dependency in the go.mod file, go get will pull single dependency(like npn install ...), see more detail on official site.

https://go.dev/ref/mod

  • Related