Currently mksyscall script produces one redundant newline
when $extraimports is empty, leading to a gofmt warning
reported by "git codereview change".
Change-Id: I57b0fa040347375698973e777285deded16ab62e
Reviewed-on: https://go-review.googlesource.com/c/go/+/587877
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
my $libc = 0;
my $tags = ""; # build tags
my $newtags = ""; # new style build tags
+my $stdimports = 'import "unsafe"';
my $extraimports = "";
if($ARGV[0] eq "-b32") {
exit 1;
}
+if($extraimports ne "") {
+ $stdimports .= "\n$extraimports";
+}
+
# TODO: this assumes tags are just simply comma separated. For now this is all the uses.
$newtags = $tags =~ s/,/ && /r;
package syscall
-import "unsafe"
-$extraimports
+$stdimports
$text
EOF