mirror of
https://github.com/golang/go
synced 2024-11-12 01:10:21 -07:00
codereview: don't run gofmt with an empty file list
R=gri CC=golang-dev https://golang.org/cl/1678054
This commit is contained in:
parent
4c0de303ce
commit
ad665e4fde
@ -694,6 +694,8 @@ def CheckGofmt(ui, repo, files, just_warn=False):
|
||||
cwd = os.getcwd()
|
||||
files = [RelativePath(repo.root + '/' + f, cwd) for f in files]
|
||||
files = [f for f in files if os.access(f, 0)]
|
||||
if not files:
|
||||
return
|
||||
try:
|
||||
cmd = subprocess.Popen(["gofmt", "-l"] + files, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
|
||||
cmd.stdin.close()
|
||||
|
Loading…
Reference in New Issue
Block a user