You can slice off the last character:
read_line = read_line[:len(read_line)-1]
Perhaps a better approach is to use the strings library:
read_line = strings.TrimSuffix(read_line, "\n")
You can slice off the last character:
read_line = read_line[:len(read_line)-1]
Perhaps a better approach is to use the strings library:
read_line = strings.TrimSuffix(read_line, "\n")