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..bf18848 --- /dev/null +++ b/solutions/go/welcome-to-tech-palace/1/welcome_to_tech_palace.go @@ -0,0 +1,24 @@ +package techpalace + +import "strings" +import "fmt" + +// 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 { + return strings.Repeat("*", numStarsPerLine) + "\n" + welcomeMsg + "\n" + strings.Repeat("*", numStarsPerLine) +} + +// CleanupMessage cleans up an old marketing message. +func CleanupMessage(oldMsg string) string { + starsClear := strings.ReplaceAll(oldMsg, "*", "") + + cleanMsg := strings.TrimSpace(starsClear) + fmt.Println(cleanMsg) + + return cleanMsg +}