It looks like you're confused by the working of slices and the string storage format, which is different from what you have in C.
len
operation : there is no need to count1
after slicing by adding an empty string.To remove the last char (if it's a one byte char), simply do
inputFmt:=input[:len(input)-1]