From 59b6731762a4b63f4ce5ab056d6c42a6f59c3959 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Tue, 15 Oct 2024 10:35:59 -0700 Subject: [PATCH] Use default hostname in UI when in dev mode Updates #144 Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris --- golink.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/golink.go b/golink.go index b58b60c..6d26df9 100644 --- a/golink.go +++ b/golink.go @@ -299,7 +299,13 @@ func init() { } var tmplFuncs = template.FuncMap{ + // go is a template function that returns the hostname of the golink service. + // This is used throughout the UI to render links, but does not impact link resolution. "go": func() string { + if devMode() { + // in dev mode, just use "go" instead of "localhost:8080" + return defaultHostname + } return *hostname }, }