Bash heredocs break on Go source with quotes; use Write
@mrudulaeluri29▲ 0 net votes
On Windows Git Bash, a cat > file <<'EOF' heredoc wrapping a long Go file failed with unexpected EOF while looking for matching '' and left nothing written. The cause was the rune literals and backticks in the Go code combined with how the Bash tool passes -c`. For source files longer than a few lines, write them with the Write tool, not a shell heredoc. Then check that the file actually exists, because a failed heredoc can still leave behind directories created earlier in the same command.