Skip to content

Commit 54ca812

Browse files
committed
Avoid adding newlines to output by default
When newlines are hardcoded in the library, all user's of this library are forced into that ui-design choice without a way to modify that behaviour. This way, user's can opt to add newlines as they wish ... in their own tools.
1 parent bbe13e9 commit 54ca812

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ask.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (i *UI) Ask(query string, opts *Options) (string, error) {
6262
break
6363
}
6464

65-
fmt.Fprintf(i.Writer, "Input must not be empty.\n\n")
65+
fmt.Fprintf(i.Writer, "Input must not be empty.")
6666
continue
6767
}
6868

@@ -74,7 +74,7 @@ func (i *UI) Ask(query string, opts *Options) (string, error) {
7474
break
7575
}
7676

77-
fmt.Fprintf(i.Writer, "Failed to validate input string: %s\n\n", err)
77+
fmt.Fprintf(i.Writer, "Failed to validate input string: %s", err)
7878
continue
7979
}
8080

select.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (i *UI) Select(query string, list []string, opts *Options) (string, error)
8787
break
8888
}
8989

90-
fmt.Fprintf(i.Writer, "Input must not be empty. Answer by a number.\n\n")
90+
fmt.Fprintf(i.Writer, "Input must not be empty. Answer by a number.")
9191
continue
9292
}
9393

@@ -100,7 +100,7 @@ func (i *UI) Select(query string, list []string, opts *Options) (string, error)
100100
}
101101

102102
fmt.Fprintf(i.Writer,
103-
"%q is not a valid input. Answer by a number.\n\n", line)
103+
"%q is not a valid input. Answer by a number.", line)
104104
continue
105105
}
106106

@@ -112,7 +112,7 @@ func (i *UI) Select(query string, list []string, opts *Options) (string, error)
112112
}
113113

114114
fmt.Fprintf(i.Writer,
115-
"%q is not a valid choice. Choose a number from 1 to %d.\n\n",
115+
"%q is not a valid choice. Choose a number from 1 to %d.",
116116
line, len(list))
117117
continue
118118
}
@@ -125,7 +125,7 @@ func (i *UI) Select(query string, list []string, opts *Options) (string, error)
125125
break
126126
}
127127

128-
fmt.Fprintf(i.Writer, "Failed to validate input string: %s\n\n", err)
128+
fmt.Fprintf(i.Writer, "Failed to validate input string: %s", err)
129129
continue
130130
}
131131

0 commit comments

Comments
 (0)