How do you set the application icon in golang?

前端 未结 5 936
抹茶落季
抹茶落季 2021-01-30 09:14

I\'ve just created my first go application on Windows.

How do I give it an icon?

There doesn\'t seem to be any build flags to do this, and I know golang doesn\'t

5条回答
  •  萌比男神i
    2021-01-30 09:58

    There is a github package GoVersionInfo by Joseph Spurrier:

    Microsoft Windows File Properties/Version Info and Icon Resource Generator for the Go Language

    Package creates a syso file which contains Microsoft Windows Version Information and an optional icon. When you run "go build", Go will embed the version information and an optional icon and an optional manifest in the executable. Go will automatically use the syso file if it's in the same directory as the main() function.

提交回复
热议问题