Complete inbox CLI implementation

This commit is contained in:
2026-03-19 03:15:17 +08:00
parent 11bee52ff4
commit c3314cd9cf
15 changed files with 1524 additions and 43 deletions
+21
View File
@@ -0,0 +1,21 @@
package inbox
import (
"fmt"
"os"
)
func resolveBodyValue(body, bodyFile string) (string, error) {
if body != "" && bodyFile != "" {
return "", fmt.Errorf("body and body-file are mutually exclusive")
}
if bodyFile == "" {
return body, nil
}
content, err := os.ReadFile(bodyFile)
if err != nil {
return "", fmt.Errorf("read body file %q: %w", bodyFile, err)
}
return string(content), nil
}