I have a problem versioning my Windows executables created with go.
Here is my main.go
package main
import (
"fmt"
)
func main() {
fmt.Println("hello world")
}
Here is winres/winres.json:
{
"RT_VERSION": {
"#1": {
"0000": {
"fixed": {
"file_version": "1.0.250651.0",
"product_version": "1.0.250651.0"
}
}
}
}
}
Here is my go.mod
module helloworld
go 1.24
And here is my build script I run in git bash on my windows laptop:
#!/bin/bash
go-winres make
GOOS=windows GOARCH=amd64 go build
powershell.exe -Command "[System.Diagnostics.FileVersionInfo]::GetVersionInfo(\"helloworld.exe\")"
Unfortunately, this is the output:
ProductVersion FileVersion FileName
-------------- ----------- --------
So I created syso files based version info but apparently, my build does not include it in the right way to make sure my executable is correctly versioned.
What am i doing wrong? Executables and syso files are created. So I really do not understand. Help me solving this.