I think this is fine, but it is also an option to do:

InitHooks = append(InitHooks, func() { loadMessages(path.Join(BasePath, messageFilesDirectory)) })

if you don't want to create a named function for it.