Skip to content

Instantly share code, notes, and snippets.

@gokaybiz
Created February 16, 2020 23:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gokaybiz/e8714b78e810df9d693ab8bc22634546 to your computer and use it in GitHub Desktop.
Save gokaybiz/e8714b78e810df9d693ab8bc22634546 to your computer and use it in GitHub Desktop.
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