dotfiles/bin/golintc
2016-01-08 15:34:54 -05:00

22 lines
342 B
Perl
Executable file

#!/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;