From 7bdb4235b67bb99b62d7acb44139ed6acdde0780 Mon Sep 17 00:00:00 2001 From: "exercism-solutions-syncer[bot]" <211797793+exercism-solutions-syncer[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 16:10:07 +0000 Subject: [PATCH] [Sync Iteration] go/welcome-to-tech-palace/1 --- .../1/welcome_to_tech_palace.go | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 solutions/go/welcome-to-tech-palace/1/welcome_to_tech_palace.go diff --git a/solutions/go/welcome-to-tech-palace/1/welcome_to_tech_palace.go b/solutions/go/welcome-to-tech-palace/1/welcome_to_tech_palace.go new file mode 100644 index 0000000..4aeeade --- /dev/null +++ b/solutions/go/welcome-to-tech-palace/1/welcome_to_tech_palace.go @@ -0,0 +1,36 @@ +package techpalace + +import ( + "fmt" + "strings" +) + +// WelcomeMessage returns a welcome message for the customer. +func WelcomeMessage(customer string) string { + name := strings.ToUpper(customer) + message:= fmt.Sprintf("Welcome to the Tech Palace, %s", name) + return message +} + +// AddBorder adds a border to a welcome message. +func AddBorder(welcomeMsg string, numStarsPerLine int) string { + var result string = "" + for i := 0; i < numStarsPerLine; i++ { + result += "*" + } + result += "\n" + welcomeMsg + "\n" + + for i := 0; i < numStarsPerLine; i++ { + result += "*" + } + return result + // border := strings.Repeat("*", numStarsPerLine) + // return border + "\n" + welcomeMsg + "\n" + border +} + +// CleanupMessage cleans up an old marketing message. +func CleanupMessage(oldMsg string) string { + + nostar := strings.ReplaceAll(oldMsg, "*", "") + return strings.TrimSpace(nostar) +}