cmd/gogio: compile when no icon is found

Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
Inkeliz
2021-10-03 13:45:08 +01:00
committed by Elias Naur
parent d6e6ca848a
commit 50476239f6
+4
View File
@@ -3,6 +3,7 @@ package main
import (
"bytes"
"encoding/binary"
"errors"
"fmt"
"image/png"
"io"
@@ -119,6 +120,9 @@ func (b *bufferCoff) Size() int64 {
func (b *windowsBuilder) embedIcon(path string) (err error) {
iconFile, err := os.Open(path)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return nil
}
return fmt.Errorf("can't read the icon located at %s: %v", path, err)
}
defer iconFile.Close()