From 40e0b3172af1e8deab80a7bf2bf95337ef9201c6 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 1 Jul 2023 21:52:08 +0800 Subject: Refactor: replace homemade result handling with library. --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main.go') 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 -- cgit v1.2.3