简体   繁体   中英

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

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 ?

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

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