Exercises & activities from the go workshop provided by Packt: https://courses.packtpub.com/courses/go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

33 lines
474 B

package main
import (
"fmt"
"os"
)
func getPassedArgs() []string {
var args []string
for i := 1; i < len(os.Args); i++ {
args = append(args, os.Args[i])
}
return args
}
func getLocals(extraLocals []string) []string {
var locales []string
locales = append(locales, "en_US", "fr_FR")
locales = append(locales, extraLocals...)
return locales
}
func main() {
locales := getLocals(getPassedArgs())
fmt.Println("Locales to use:", locales)
}