mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 10:25:37 +00:00
cmd/gogio: compile when no icon is found
Signed-off-by: Inkeliz <inkeliz@inkeliz.com>
This commit is contained in:
@@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"image/png"
|
"image/png"
|
||||||
"io"
|
"io"
|
||||||
@@ -119,6 +120,9 @@ func (b *bufferCoff) Size() int64 {
|
|||||||
func (b *windowsBuilder) embedIcon(path string) (err error) {
|
func (b *windowsBuilder) embedIcon(path string) (err error) {
|
||||||
iconFile, err := os.Open(path)
|
iconFile, err := os.Open(path)
|
||||||
if err != nil {
|
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)
|
return fmt.Errorf("can't read the icon located at %s: %v", path, err)
|
||||||
}
|
}
|
||||||
defer iconFile.Close()
|
defer iconFile.Close()
|
||||||
|
|||||||
Reference in New Issue
Block a user