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 .apdisk
tmp tmp
tmp.pdf tmp.pdf
.env *.env
*templ.txt *templ.txt

View file

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

2
go.mod
View file

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

View file

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