add transport

This commit is contained in:
Ruidy 2024-04-06 13:34:33 +02:00
parent 28866ac5fb
commit f764e1007c
No known key found for this signature in database
GPG key ID: E00F51288CB857CC
4 changed files with 12 additions and 3 deletions

2
.gitignore vendored
View file

@ -25,5 +25,5 @@ Temporary Items
.apdisk
tmp
tmp.pdf
.env
*.env
*templ.txt

View file

@ -48,6 +48,10 @@ func NewHost() *Host {
Name: "Port",
Price: 20.0,
},
{
Name: "Transport",
Price: 20.0,
},
{
Name: "Taxes",
Price: 1.5,

2
go.mod
View file

@ -1,6 +1,6 @@
module github.com/rjNemo/rentease
go 1.22.0
go 1.22.1
require (
github.com/a-h/templ v0.2.543

View file

@ -2,6 +2,7 @@ package main
import (
"embed"
"flag"
"log"
"os"
"strconv"
@ -19,10 +20,14 @@ import (
//go:embed assets
var static embed.FS
var envFile = flag.String("env", ".env", "env file name")
func init() {
flag.Parse()
if os.Getenv("ENV") != "PROD" {
err := godotenv.Load(".env")
log.Printf("Loading env file: %q", *envFile)
err := godotenv.Load(*envFile)
if err != nil {
log.Fatalln("Error loading .env file")
}