Difference between revisions of "Go mod"

From wikieduonline
Jump to navigation Jump to search
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
  go mod init YOUR_NAME
+
{{lowercase}}
  go: creating new go.mod: module YOUR_NAME
+
* https://go.dev/ref/mod
 +
  [[go mod init]]
 +
[[go mod download]]
 +
[[go mod vendor]]
 +
[[go mod verify]]
 +
[[go mod why]]
 +
  [[go mod tidy]]
 +
[[go help mod]]
  
It will create a <code>go.mod</code> file containing:
+
 
 +
 
 +
Execute:
 +
[[go mod init]] YOUR_NAME
 +
go: creating new [[go.mod]]: module YOUR_NAME
 +
 
 +
It will create a <code>[[go.mod]]</code> file containing
 
<pre>
 
<pre>
 
  module YOUR_NAME
 
  module YOUR_NAME
Line 9: Line 22:
 
</pre>
 
</pre>
  
 +
== Related ==
 +
* [[GOPATH]]
  
  
 
== See also ==
 
== See also ==
 +
* {{go mod}}
 
* {{go}}
 
* {{go}}
 +
 +
[[Category:Go]]

Latest revision as of 18:52, 26 July 2023

go mod init
go mod download
go mod vendor
go mod verify
go mod why
go mod tidy
go help mod


Execute:

go mod init YOUR_NAME
go: creating new go.mod: module YOUR_NAME

It will create a go.mod file containing

 module YOUR_NAME

 go 1.14

Related[edit]


See also[edit]

Advertising: