Skip to content

Commit 196ff6d

Browse files
committed
style adjustments
1 parent aaf3c19 commit 196ff6d

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

hound.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func (h *Hound) New() bool {
3131
return false
3232
}
3333

34-
err = h.parse(config)
34+
err = h.parseConfig(config)
3535
if err != nil {
3636
return false
3737
}
@@ -85,8 +85,8 @@ func (h *Hound) loadConfig() ([]byte, error) {
8585
return ioutil.ReadFile(filename)
8686
}
8787

88-
// parse parses a configuration byte array and returns an error.
89-
func (h *Hound) parse(config []byte) error {
88+
// parseConfig parses a configuration byte array and returns an error.
89+
func (h *Hound) parseConfig(config []byte) error {
9090
return yaml.Unmarshal(config, h)
9191
}
9292

@@ -95,11 +95,10 @@ func (h *Hound) parse(config []byte) error {
9595
// will compile the pattern and store it in the cache. Returns a Regexp
9696
// and an error.
9797
func (h *Hound) regexp(pattern string) (*regexp.Regexp, error) {
98-
99-
// Ensure that we don't encounter a race condition where multiple goroutines
100-
// are attempting to read/write to the regexes map.
101-
defer func() { mutex.Unlock() }()
98+
// Make sure that we don't encounter a race condition where multiple
99+
// goroutines a
102100
mutex.Lock()
101+
defer mutex.Unlock()
103102

104103
if regexes[pattern] != nil {
105104
return regexes[pattern], nil

hound_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ skip:
1616
- '\.test$'
1717
`)
1818

19-
if err := hound.parse(config); err != nil {
20-
t.Fatalf("Should parse - %s", err)
19+
if err := hound.parseConfig(config); err != nil {
20+
t.Fatalf("Should parse config - %s", err)
2121
}
2222

2323
// Should fail with a warning

0 commit comments

Comments
 (0)