Skip to content

Instantly share code, notes, and snippets.

@gokaybiz
Created Feb 16, 2020
Embed
What would you like to do?
Add suffix between file name and extensions
func fileNameRename(fileName, suffix string) (newFName string) {
exts := strings.Split(fileName, ".")
newFName = exts[0] + "_" + suffix + fileName[len(fileName[0:len(exts[0])]):]
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment