[Solved] electron-builder Package mac Error: panic: runtime error: index out of range

An error is reported in the packaging mac of electron builder. The detailed error information is as follows:

goroutine 1 [running]:
github.com/develar/app-builder/pkg/icons.ConvertIcnsToPng(0xc0000ca630, 0x2d, 0x7ffd9f40874a, 0x2e, 0x2, 0x2, 0xc0000ca630, 0x2d, 0xe53320)
	/Volumes/data/Documents/app-builder/pkg/icons/icns-to-png.go:60 +0x4ab
github.com/develar/app-builder/pkg/icons.doConvertIcon(0xc00012a400, 0x5, 0x8, 0xc00025ec20, 0x2, 0x2, 0x7ffd9f4086ec, 0x3, 0x7ffd9f40874a, 0x2e, ...)
	/Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:226 +0xa0d
github.com/develar/app-builder/pkg/icons.ConvertIcon(0xc0000ad3c0, 0x97, 0x0, 0xf6400f7800000000)
	/Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:56 +0xd6
github.com/develar/app-builder/pkg/icons.ConfigureCommand.func1(0xc0002375f0, 0x40b705, 0xc2b0e0)
	/Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:33 +0x7f
github.com/alecthomas/kingpin.(*actionMixin).applyActions(0xc000124d98, 0xc0002375f0, 0x0, 0x0)
	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/actions.go:28 +0x6d
github.com/alecthomas/kingpin.(*Application).applyActions(0xc0000e8780, 0xc0002375f0, 0x0, 0x0)
	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:557 +0xdc
github.com/alecthomas/kingpin.(*Application).execute(0xc0000e8780, 0xc0002375f0, 0xc00021b150, 0x1, 0x1, 0x0, 0x0, 0x0, 0x904545)
	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:390 +0x90
github.com/alecthomas/kingpin.(*Application).Parse(0xc0000e8780, 0xc0000ae010, 0xf, 0xf, 0xc0000e8780, 0xc00008a058, 0x0, 0x0)
	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:222 +0x213

Solution:
put 512×512 in the icons directory of the icon Png icon to complete packaging
for example:
dist/icons/512x512.png

Read More: