mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
add transport
This commit is contained in:
parent
28866ac5fb
commit
f764e1007c
4 changed files with 12 additions and 3 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -25,5 +25,5 @@ Temporary Items
|
||||||
.apdisk
|
.apdisk
|
||||||
tmp
|
tmp
|
||||||
tmp.pdf
|
tmp.pdf
|
||||||
.env
|
*.env
|
||||||
*templ.txt
|
*templ.txt
|
||||||
|
|
|
||||||
|
|
@ -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
2
go.mod
|
|
@ -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
|
||||||
|
|
|
||||||
7
main.go
7
main.go
|
|
@ -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")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue