File tree 1 file changed +6
-9
lines changed
1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change 5
5
_ "image/png"
6
6
"log"
7
7
"os"
8
- "path/filepath"
8
+ "path"
9
+ "runtime"
9
10
10
11
gutter "github.com/Drakirus/go-flutter-desktop-embedder"
11
12
@@ -17,10 +18,8 @@ func main() {
17
18
err error
18
19
)
19
20
20
- dir , err := filepath .Abs (filepath .Dir (os .Args [0 ]))
21
- if err != nil {
22
- log .Fatal (err )
23
- }
21
+ _ , currentFilePath , _ , _ := runtime .Caller (0 )
22
+ dir := path .Dir (currentFilePath )
24
23
25
24
options := []gutter.Option {
26
25
gutter .OptionAssetPath (dir + "/flutter_project/demo/build/flutter_assets" ),
@@ -35,10 +34,8 @@ func main() {
35
34
}
36
35
37
36
func setIcon (window * glfw.Window ) error {
38
- dir , err := filepath .Abs (filepath .Dir (os .Args [0 ]))
39
- if err != nil {
40
- return err
41
- }
37
+ _ , currentFilePath , _ , _ := runtime .Caller (0 )
38
+ dir := path .Dir (currentFilePath )
42
39
imgFile , err := os .Open (dir + "/assets/icon.png" )
43
40
if err != nil {
44
41
return err
You can’t perform that action at this time.
0 commit comments