Trim trailing newline

cf. https://code.google.com/p/go/issues/detail?id=7767