summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorKeuin <[email protected]>2023-07-01 21:52:08 +0800
committerKeuin <[email protected]>2023-07-01 21:52:27 +0800
commit40e0b3172af1e8deab80a7bf2bf95337ef9201c6 (patch)
tree2b99c5028a1b799d0887f028351bde3560f72d5c /main.go
parent6c3c988bae6f8a78afd3503743106395792ee2b0 (diff)
Refactor: replace homemade result handling with library.
Diffstat (limited to 'main.go')
-rw-r--r--main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.go b/main.go
index 84f8a5c..b53b63b 100644
--- a/main.go
+++ b/main.go
@@ -14,6 +14,7 @@ import (
"github.com/keuin/slbr/logging"
"github.com/keuin/slbr/recording"
"github.com/mitchellh/mapstructure"
+ "github.com/samber/mo"
"github.com/spf13/viper"
"log"
"os"
@@ -131,7 +132,7 @@ func getTasks() (tasks []recording.TaskConfig) {
// generate task list from cli
taskCount := len(*rooms)
tasks = make([]recording.TaskConfig, taskCount)
- saveTo := common.Zeroable[string](*saveToPtr).OrElse(".")
+ saveTo := mo.EmptyableToOption(*saveToPtr).OrElse(".")
diskBufSize := uint64(*diskBufSizePtr)
if *diskBufSizePtr <= 0 {
diskBufSize = defaultDiskBufSize