Skip to content

Commit

Permalink
Added env var override
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelloeater committed Sep 9, 2024
1 parent db92c54 commit 0f3215a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ var ( // Create by GoRelease at compile time

func writeDate(format string, timezone string) {

if os.Getenv("STAMPY_TZ") != "" {
timezone = os.Getenv("STAMPY_TZ")
}
if os.Getenv("STAMPY_FORMAT") != "" {
format = os.Getenv("STAMPY_FORMAT")
}

loc, e := time.LoadLocation(timezone)
if e != nil {
log.Fatal(e)
Expand Down

0 comments on commit 0f3215a

Please sign in to comment.