This commit is contained in:
		
							parent
							
								
									b44adc4f5d
								
							
						
					
					
						commit
						1015670704
					
				
					 1 changed files with 4 additions and 5 deletions
				
			
		
							
								
								
									
										9
									
								
								main.go
									
										
									
									
									
								
							
							
						
						
									
										9
									
								
								main.go
									
										
									
									
									
								
							| 
						 | 
					@ -8,7 +8,6 @@ import (
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	mqtt "github.com/eclipse/paho.mqtt.golang"
 | 
						mqtt "github.com/eclipse/paho.mqtt.golang"
 | 
				
			||||||
	"github.com/joho/godotenv"
 | 
					 | 
				
			||||||
	_ "github.com/lib/pq"
 | 
						_ "github.com/lib/pq"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -41,10 +40,10 @@ var db *sql.DB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func main() {
 | 
					func main() {
 | 
				
			||||||
	// Load environment variables from .env file if it exists
 | 
						// Load environment variables from .env file if it exists
 | 
				
			||||||
	err := godotenv.Load()
 | 
						// err := godotenv.Load()
 | 
				
			||||||
	if err != nil {
 | 
						// if err != nil {
 | 
				
			||||||
		log.Println("Error loading .env file:", err)
 | 
						// 	log.Println("Error loading .env file:", err)
 | 
				
			||||||
	}
 | 
						// }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Connect to PostgreSQL
 | 
						// Connect to PostgreSQL
 | 
				
			||||||
	pgConnStr := os.Getenv("PG_DB")
 | 
						pgConnStr := os.Getenv("PG_DB")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue