From 4af1eefae38d85a0e426b93ebf33a1835d8d7c97 Mon Sep 17 00:00:00 2001 From: sam boyer Date: Tue, 10 Jan 2017 22:00:30 -0500 Subject: [PATCH] Methodize & rename default signal handling func --- manager_test.go | 6 +++--- source_manager.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manager_test.go b/manager_test.go index da52df0..beda41a 100644 --- a/manager_test.go +++ b/manager_test.go @@ -739,7 +739,7 @@ func TestSignalHandling(t *testing.T) { clean() sm, clean = mkNaiveSM(t) - SetUpSigHandling(sm) + sm.UseDefaultSignalHandling() go sm.DeduceProjectRoot("rsc.io/pdf") runtime.Gosched() @@ -769,9 +769,9 @@ func TestSignalHandling(t *testing.T) { clean() sm, clean = mkNaiveSM(t) - SetUpSigHandling(sm) + sm.UseDefaultSignalHandling() sm.StopSignalHandling() - SetUpSigHandling(sm) + sm.UseDefaultSignalHandling() go sm.DeduceProjectRoot("rsc.io/pdf") //runtime.Gosched() diff --git a/source_manager.go b/source_manager.go index c8634f7..013eea5 100644 --- a/source_manager.go +++ b/source_manager.go @@ -171,9 +171,9 @@ func NewSourceManager(an ProjectAnalyzer, cachedir string) (*SourceMgr, error) { return sm, nil } -// SetUpSigHandling sets up typical os.Interrupt signal handling for a +// UseDefaultSignalHandling sets up typical os.Interrupt signal handling for a // SourceMgr. -func SetUpSigHandling(sm *SourceMgr) { +func (sm *SourceMgr) UseDefaultSignalHandling() { sigch := make(chan os.Signal, 1) signal.Notify(sigch, os.Interrupt) sm.HandleSignals(sigch)