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..3df6f12 --- /dev/null +++ b/solutions/go/welcome-to-tech-palace/1/welcome_to_tech_palace.go @@ -0,0 +1,21 @@ +package techpalace + +import "strings" + +// WelcomeMessage returns a welcome message for the customer. +func WelcomeMessage(customer string) string { + return "Welcome to the Tech Palace, " + strings.ToUpper(customer) +} + +// AddBorder adds a border to a welcome message. +func AddBorder(welcomeMsg string, numStarsPerLine int) string { + border := strings.Repeat("*",numStarsPerLine) + return border+"\n"+welcomeMsg+"\n"+border +} + +// CleanupMessage cleans up an old marketing message. +func CleanupMessage(oldMsg string) string { + noStars := strings.ReplaceAll(oldMsg, "*", "") + trimmedMessage := strings.TrimSpace(noStars) + return trimmedMessage +}