summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-01-06 22:33:50 +0200
committerPaul Buetow <paul@buetow.org>2025-01-06 22:33:50 +0200
commitf2715f0a6e055198765471020047987b6296e0d3 (patch)
tree7a8e838f6a6cc648e0672640b5fbbf8edb36b7b2
parentb9beca8449a10ba53807ecfc7d4b15cb6f14e82e (diff)
colour function names to be more consistent
-rw-r--r--internal/colour/colour.go6
-rw-r--r--internal/platforms/linkedin/oauth2/oauth2.go4
-rw-r--r--internal/platforms/platform.go2
-rw-r--r--internal/prompt/file.go4
-rw-r--r--internal/prompt/prompt.go2
-rw-r--r--internal/queue/queue.go2
6 files changed, 10 insertions, 10 deletions
diff --git a/internal/colour/colour.go b/internal/colour/colour.go
index 5cefc58..0b11163 100644
--- a/internal/colour/colour.go
+++ b/internal/colour/colour.go
@@ -7,14 +7,14 @@ import (
)
var (
- Infof = func(format string, args ...any) {
+ Infofln = func(format string, args ...any) {
fmt.Printf(format, args...)
fmt.Print("\n")
}
Infoln = func(args ...any) { fmt.Println(args...) }
info2Col = color.New(color.FgHiYellow, color.BgBlue)
- Info2f = func(format string, args ...any) {
+ Info2fln = func(format string, args ...any) {
info2Col.Printf(format, args...)
fmt.Print("\n")
}
@@ -24,7 +24,7 @@ var (
Warnln = warnCol.PrintlnFunc()
successCol = color.New(color.FgWhite, color.BgGreen)
- Successf = func(format string, args ...any) {
+ Successfln = func(format string, args ...any) {
successCol.Printf(format, args...)
fmt.Print("\n")
diff --git a/internal/platforms/linkedin/oauth2/oauth2.go b/internal/platforms/linkedin/oauth2/oauth2.go
index a07d4bc..dfaad19 100644
--- a/internal/platforms/linkedin/oauth2/oauth2.go
+++ b/internal/platforms/linkedin/oauth2/oauth2.go
@@ -162,9 +162,9 @@ func WaitUntilURLIsReachable(url string) error {
resp, err := http.Get(url)
if err != nil {
- colour.Infof("URL is not reachable: %v", err)
+ colour.Infofln("URL is not reachable: %v", err)
} else {
- colour.Infof("URL is reachable: %s - Status Code: %d", url, resp.StatusCode)
+ colour.Infofln("URL is reachable: %s - Status Code: %d", url, resp.StatusCode)
resp.Body.Close()
return nil
}
diff --git a/internal/platforms/platform.go b/internal/platforms/platform.go
index 6d80ee2..6cc0ce5 100644
--- a/internal/platforms/platform.go
+++ b/internal/platforms/platform.go
@@ -56,7 +56,7 @@ func (p Platform) Post(ctx context.Context, args config.Args, sizeLimit int, en
return err
}
- colour.Successf("Successfully posted message to %s", p)
+ colour.Successfln("Successfully posted message to %s", p)
return nil
}
diff --git a/internal/prompt/file.go b/internal/prompt/file.go
index 7da24aa..11e32a2 100644
--- a/internal/prompt/file.go
+++ b/internal/prompt/file.go
@@ -20,8 +20,8 @@ var (
)
func FileAction(question, content, filePath string, includeRandomOption ...bool) (string, error) {
- colour.Info2f("%s:", filePath)
- colour.Info2f("%s", content)
+ colour.Info2fln("%s:", filePath)
+ colour.Info2fln("%s", content)
reader := bufio.NewReader(os.Stdin)
includeRandom := len(includeRandomOption) > 0 && includeRandomOption[0] == RandomOption
diff --git a/internal/prompt/prompt.go b/internal/prompt/prompt.go
index 31eeefc..646888f 100644
--- a/internal/prompt/prompt.go
+++ b/internal/prompt/prompt.go
@@ -11,7 +11,7 @@ import (
func Acknowledge(messages ...string) error {
if len(messages) > 1 {
for _, content := range messages[1:] {
- colour.Info2f("%s", content)
+ colour.Info2fln("%s", content)
fmt.Print("\n")
}
}
diff --git a/internal/queue/queue.go b/internal/queue/queue.go
index cc9de9c..397c438 100644
--- a/internal/queue/queue.go
+++ b/internal/queue/queue.go
@@ -110,7 +110,7 @@ func queuePlatforms(args config.Args) error {
// Keep queued items in trash for a while.
trashPath := filepath.Join(trashDir, strings.TrimSuffix(filepath.Base(en.Path), ".queued")+".trash")
- colour.Infof("Trashing %s -> %s", en.Path, trashPath)
+ colour.Infofln("Trashing %s -> %s", en.Path, trashPath)
if err := oi.EnsureParentDir(trashPath); err != nil {
return err
}