Skip to content

Commit eb6d142

Browse files
committed
fix type
1 parent ea1368b commit eb6d142

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

input/backend.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func GetAllBackendNames() []string {
4343
return out
4444
}
4545

46-
// Get the default backend depending on
46+
// Get the default backend depending on runtime.GOOS
4747
func DefaultBackend() string {
4848
switch runtime.GOOS {
4949
case "windows":
@@ -52,25 +52,23 @@ func DefaultBackend() string {
5252
}
5353

5454
case "darwin":
55-
if backend := FindBackend("portaudio"); backend != nil {
56-
if HasBackend("portaudio") {
57-
return "portaudio"
58-
}
55+
if HasBackend("portaudio") {
56+
return "portaudio"
5957
}
6058

6159
if HasBackend("ffmpeg-avfoundation") {
6260
return "ffmpeg-avfoundation"
6361
}
6462

6563
case "linux":
66-
if path, _ := exec.LookPath("pw-cat"); path != "" {
67-
if HasBackend("pipewire") {
64+
if HasBackend("pipewire") {
65+
if path, _ := exec.LookPath("pw-cat"); path != "" {
6866
return "pipewire"
6967
}
7068
}
7169

72-
if path, _ := exec.LookPath("parec"); path != "" {
73-
if HasBackend("parec") {
70+
if HasBackend("parec") {
71+
if path, _ := exec.LookPath("parec"); path != "" {
7472
return "parec"
7573
}
7674
}

0 commit comments

Comments
 (0)