Go cli: Difference between revisions
Jump to navigation
Jump to search
Line 12: | Line 12: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
go run src/cmds/hello/hello.go | go run src/cmds/hello/hello.go | ||
</syntaxhighlight> | |||
==Build== | |||
Compiles but does not run a program | |||
<br> | |||
Given the tree | |||
[[File:Go cli tree.png]] | |||
<syntaxhighlight lang="bash"> | |||
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