What were you expecting to happen? The documentation says:
Both pattern and replacement must be valid Go expressions. In the pat‐ tern, single-character lowercase identifiers serve as wildcards match‐ ing arbitrary sub-expressions; those expressions will be substituted for the same identifiers in the replacement. So if 'h' had shown up in the replacement, it would get replaced with the original identifier - but it did not appear, instead H did. It *looks* like you were expecting it to change the "hello, world\n" to "Hello, world\n"? But gofmt's -r requires that both pattern and replacement be valid Go expressions. This: gofmt -r "\"hello, world\\n\" -> \"Hello, world\\n\"" Has the effect I think you might have been going for. I'm not certain what you were intending though, so I'm not sure of that. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.