Go cli: Difference between revisions
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==Build== | ==Build== | ||
Compiles but does not run a program | Compiles but does not run a program. Given the tree | ||
<br> | <br> | ||
[[File:Go cli tree.png]] | [[File:Go cli tree.png]] | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
go build hello | go build hello | ||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 02:18, 30 January 2021
Introduction
This is just a page on go command options
go help <command>
// e.g.
go help test
We can go to https://golang.org/cmd/go/ for online
Building and Running
Run
Compiles and run a program without leaving artefacts.
go run src/cmds/hello/hello.go
Build
Compiles but does not run a program. Given the tree
go build hello