mirror of
https://github.com/docker/compose.git
synced 2025-07-26 23:24:05 +02:00
watch: fix a dumb errcheck (#3622)
This commit is contained in:
parent
b3615d64e2
commit
8b39322365
@ -80,7 +80,7 @@ func DesiredWindowsBufferSize() int {
|
|||||||
envVar := os.Getenv(WindowsBufferSizeEnvVar)
|
envVar := os.Getenv(WindowsBufferSizeEnvVar)
|
||||||
if envVar != "" {
|
if envVar != "" {
|
||||||
size, err := strconv.Atoi(envVar)
|
size, err := strconv.Atoi(envVar)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,20 @@ import (
|
|||||||
// Each implementation of the notify interface should have the same basic
|
// Each implementation of the notify interface should have the same basic
|
||||||
// behavior.
|
// behavior.
|
||||||
|
|
||||||
|
func TestWindowsBufferSize(t *testing.T) {
|
||||||
|
orig := os.Getenv(WindowsBufferSizeEnvVar)
|
||||||
|
defer os.Setenv(WindowsBufferSizeEnvVar, orig)
|
||||||
|
|
||||||
|
os.Setenv(WindowsBufferSizeEnvVar, "")
|
||||||
|
assert.Equal(t, defaultBufferSize, DesiredWindowsBufferSize())
|
||||||
|
|
||||||
|
os.Setenv(WindowsBufferSizeEnvVar, "a")
|
||||||
|
assert.Equal(t, defaultBufferSize, DesiredWindowsBufferSize())
|
||||||
|
|
||||||
|
os.Setenv(WindowsBufferSizeEnvVar, "10")
|
||||||
|
assert.Equal(t, 10, DesiredWindowsBufferSize())
|
||||||
|
}
|
||||||
|
|
||||||
func TestNoEvents(t *testing.T) {
|
func TestNoEvents(t *testing.T) {
|
||||||
f := newNotifyFixture(t)
|
f := newNotifyFixture(t)
|
||||||
defer f.tearDown()
|
defer f.tearDown()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user