Skip to content

Building Locally

Workspace Prerequisites

All the prerequisites mentioned in Installation Prerequisites must be fulfilled.

  • Install Go for Windows.

Build Go projects

Building Go based projects is done through BuildGoExe.ps1

Tip

bgo.cmd is a shortcut command to invoke the script BuildGoExe.ps1.
If you have not installed K2s yet, then your PATH is not updated with the required locations. In this case, look for bgo.cmd and invoke the build command.

In the below example, c:\k is the root of the Git repo:

Bash Session
where bgo
C:\k\bin\bgo.cmd

Building httpproxy Go project:

Bash Session
C:\k\bin\bgo -ProjectDir "C:\k\k2s\cmd\httpproxy\" -ExeOutDir "c:\k\bin"

Info

The k2s CLI can be built without any parameters:

Bash Session
C:\k\bin\bgo

To build all Go executables:

Bash Session
C:\k\bin\bgo -BuildAll

If K2s is installed then just simply execute the command without the full path:

Bash Session
bgo -ProjectDir "C:\k\k2s\cmd\httpproxy\" -ExeOutDir "c:\k\bin"
bgo -BuildAll