From 3bca0c7d87c96206bd4abd5d33aad5851d9bd393 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Wed, 9 Apr 2014 17:40:05 -0700 Subject: [PATCH] imports: use chan struct{} for disk semaphore Update golang/go#7747 LGTM=bradfitz R=bradfitz, iant CC=golang-codereviews https://golang.org/cl/86280043 --- imports/fix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imports/fix.go b/imports/fix.go index 8e6921b3..dd3d8170 100644 --- a/imports/fix.go +++ b/imports/fix.go @@ -175,9 +175,9 @@ var pkgIndex struct { } // gate is a semaphore for limiting concurrency. -type gate chan bool +type gate chan struct{} -func (g gate) enter() { g <- true } +func (g gate) enter() { g <- struct{}{} } func (g gate) leave() { <-g } // fsgate protects the OS & filesystem from too much concurrency.