Nuke the last of the explicit types in favor of using language idioms

This commit is contained in:
Sean Chittenden 2016-06-01 14:13:51 -07:00
parent b1ee131db8
commit 56a9981a13
No known key found for this signature in database
GPG key ID: 4EBC9DC16C2E5E16

View file

@ -20,9 +20,6 @@ import (
"github.com/hashicorp/nomad/nomad/types"
)
type notifyEvent struct{}
type notifyChannel chan notifyEvent
// Syncer allows syncing of services and checks with Consul
type Syncer struct {
client *consul.Client
@ -46,7 +43,7 @@ type Syncer struct {
// periodicCallbacks is walked sequentially when the timer in Run
// fires.
periodicCallbacks map[string]types.PeriodicCallback
notifySyncCh notifyChannel
notifySyncCh chan struct{}
periodicLock sync.RWMutex
}
@ -168,7 +165,7 @@ func (c *Syncer) SetServiceIdentifier(serviceIdentifier string) *Syncer {
// to be synced immediately.
func (c *Syncer) SyncNow() {
select {
case c.notifySyncCh <- notifyEvent{}:
case c.notifySyncCh <- struct{}{}:
default:
}
}