From 18746d68822fcb7dbd4bbc97d03185ee04ffdcb2 Mon Sep 17 00:00:00 2001 From: Yonas Yanfa Date: Mon, 26 Jun 2023 08:30:36 -0400 Subject: [PATCH] Make use of environment variables --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index d11030d1c0f50ea9cd7ace94e15fa3f3c5c44938..be2668f829c0bde0f213909e16c9c9feeae95fa8 100644 --- a/main.go +++ b/main.go @@ -10,6 +10,7 @@ import ( "github.com/signintech/gopdf" "github.com/spf13/cobra" + "github.com/spf13/viper" ) //go:embed Inter.ttf @@ -41,6 +42,8 @@ var ( ) func init() { + viper.AutomaticEnv() + generateCmd.Flags().StringVar(&id, "id", time.Now().Format("20060102"), "ID") generateCmd.Flags().StringVar(&title, "title", "INVOICE", "Title")