dotfiles/bin/executable_golintc
2024-05-18 18:27:41 -07:00

22 lines
342 B
Perl

#!/usr/bin/env perl
use strict;
use warnings;
my $a = join(" ", @ARGV);
my $cmd = "golint " . $a;
open(my $fh, '-|', $cmd)
or die "Could not run golint";
my $cnt = 0;
while (my $row = <$fh>) {
chomp $row;
if ($row !~ /should have comment or be unexported/) {
print "$row\n";
$cnt++;
}
}
if ($cnt > 0) {
exit 1;
}
exit 0;