added godotenv to load env variables
This commit is contained in:
		
							
								
								
									
										10
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								main.go
									
									
									
									
									
								
							@@ -2,12 +2,20 @@ package main
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
	"embed"
 | 
						"embed"
 | 
				
			||||||
 | 
						"github.com/joho/godotenv"
 | 
				
			||||||
	"github.com/wailsapp/wails/v2"
 | 
						"github.com/wailsapp/wails/v2"
 | 
				
			||||||
	"github.com/wailsapp/wails/v2/pkg/options"
 | 
						"github.com/wailsapp/wails/v2/pkg/options"
 | 
				
			||||||
	"github.com/wailsapp/wails/v2/pkg/options/assetserver"
 | 
						"github.com/wailsapp/wails/v2/pkg/options/assetserver"
 | 
				
			||||||
 | 
						"log"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						err := godotenv.Load()
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							log.Fatal("Error loading .env file")
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//go:embed all:frontend/dist
 | 
					//go:embed all:frontend/dist
 | 
				
			||||||
var assets embed.FS
 | 
					var assets embed.FS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user