Skip to content

Instantly share code, notes, and snippets.

Created Feb 16, 2020
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])]):]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment