Go-TextType Documentation v1.1.6 Help

How to contribute to the project?

You should start reading the Contributor Guide, the Code of Conduct and the Security Policy.

Project Dependencies

This project primarily utilizes the Go programming language. Presented are the essential Go packages, along with their purposes:

How to get started

This guide will help you contribute to the Go-TextType project. Follow the steps below to get started:

System setup

  1. Set up the Go SDK.

  2. Install a C-Compiler:

    • The steps for installing with MSYS2 (recommended) are:

      • Download and install the latest version of MSYS2.

      • Once installed, do not use the MSYS terminal that opens

      • Open “MSYS2 MinGW64” from the start menu

      • Execute the following commands (if asked for installation options, be sure to choose “all”):

    pacman -Syu pacman -S git mingw-w64-x86_64-toolchain
    • You will need to add /c/Program\ Files/Go/bin and ~/Go/bin to your $PATH, for MSYS2 you can paste the following command into your terminal:

    echo "export PATH=\$PATH:/c/Program\ Files/Go/bin:~/Go/bin" >> ~/.bashrc`
    • For the compiler to work on other terminals, you will need to set up the windows PATH variable to find these tools.


      Go to the “Edit the system environment variables” control panel, tap “Advanced” and add “C:\msys64\mingw64\bin” to the Path list.

  3. Install UPX:

    • If you have chocolatey installed, run choco install upx from the command line with administrator privileges.

      • If you don't have chocolatey installed, you can get the latest UPX – X64 Win64 version from GitHub and install it.

Get the source code from GitHub

git clone https://github.com/HRA42/Go-TextType.git

Download the dependencies

Write-Host "Installing dependencies" go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo go get github.com/akavel/rsrc go install github.com/akavel/rsrc go get . go mod tidy

Or run:

Powershell.exe -File .\build.ps1 dep

Build the application

Set the version and build ID

  • Setting the version and build ID is needed to have a unique version for each build and check the logs.

$Version = "CHANGEME" $BuildID = Get-Date -Format "Hmmss"

Clean the application folder

Check the docs for cleaning

This is done by the build command automatically (see below).

Build the application with upx compression

  • The UPX compression will reduce the size of the executable by up to 69%. This will increase the startup time.

Write-Host "Starting build..." go mod tidy Write-Host "Generating binary icon" rsrc -arch amd64 -ico .\internal\trayMenu\icon.ico Write-Host "Generating binary version info" goversioninfo -64 -product-ver-build $BuildID -ver-build $BuildID Write-Host "Building project" go build -ldflags ` "-extldflags '-static' -w -s -H windowsgui -X main.AppVersion=$Version -X main.BuildID=$BUILDID" ` -o .\bin\TextType.exe . Write-Host "Build completed." Write-Host "Compressing the binary"

Or run:

Powershell.exe -File .\build.ps1 build

Clean the application and temp files

Write-Host "Cleaning project" go clean Write-Host "Cleaning binary folder" if (Test-Path .\bin) { Remove-Item -Force -Recurse .\bin } else { Write-Host "No binary folder to clean." }

Or run:

Powershell.exe -File .\build.ps1 clean
Last modified: 01 May 2024