def go_str(value):
io = StringIO.StringIO()<EOL>io.write('<STR_LIT:">')<EOL>for c in value:<EOL><INDENT>if c in _ESCAPES:<EOL><INDENT>io.write(_ESCAPES[c])<EOL><DEDENT>elif c in _SIMPLE_CHARS:<EOL><INDENT>io.write(c)<EOL><DEDENT>else:<EOL><INDENT>io.write(r'<STR_LIT>'.format(ord(c)))<EOL><DEDENT><DEDENT>io.write('<STR_LIT:">')<EOL>return io.getvalue()<EOL>
Returns value as a valid Go string literal.