@@ -98,31 +98,31 @@ func updateTable() {
9898 writeBuf ("\033 [?7l" )
9999 }
100100
101- writeBuf ("Running network-observability-cli as %s Capture\n " , captureType )
102- writeBuf ("Log level: %s " , logLevel )
103- writeBuf ("Duration: %s " , currentTime ().Sub (startupTime ).Round (time .Second ))
104- writeBuf ("Capture size: %s\n " , sizestr .ToString (totalBytes ))
101+ writeBuff ("Running network-observability-cli as %s Capture\n " , captureType )
102+ writeBuff ("Log level: %s " , logLevel )
103+ writeBuff ("Duration: %s " , currentTime ().Sub (startupTime ).Round (time .Second ))
104+ writeBuff ("Capture size: %s\n " , sizestr .ToString (totalBytes ))
105105 if len (strings .TrimSpace (options )) > 0 {
106- writeBuf ("Options: %s\n " , options )
106+ writeBuff ("Options: %s\n " , options )
107107 }
108108
109109 if totalBytes > 0 {
110110 if strings .Contains (options , "background=true" ) {
111- writeBuf ("Showing last: %d\n " , showCount )
112- writeBuf ("Display: %s\n " , display .getCurrentItem ().name )
113- writeBuf ("Enrichment: %s\n " , enrichment .getCurrentItem ().name )
111+ writeBuff ("Showing last: %d\n " , showCount )
112+ writeBuff ("Display: %s\n " , display .getCurrentItem ().name )
113+ writeBuff ("Enrichment: %s\n " , enrichment .getCurrentItem ().name )
114114 } else {
115- writeBuf ("Showing last: %d Use Up / Down keyboard arrows to increase / decrease limit\n " , showCount )
116- writeBuf ("Display: %s Use Left / Right keyboard arrows to cycle views\n " , display .getCurrentItem ().name )
117- writeBuf ("Enrichment: %s Use Page Up / Page Down keyboard keys to cycle enrichment scopes\n " , enrichment .getCurrentItem ().name )
115+ writeBuff ("Showing last: %d Use Up / Down keyboard arrows to increase / decrease limit\n " , showCount )
116+ writeBuff ("Display: %s Use Left / Right keyboard arrows to cycle views\n " , display .getCurrentItem ().name )
117+ writeBuff ("Enrichment: %s Use Page Up / Page Down keyboard keys to cycle enrichment scopes\n " , enrichment .getCurrentItem ().name )
118118 }
119119
120120 if display .getCurrentItem ().name == rawDisplay {
121121 outputBuffer .WriteString ("Raw flow logs:\n " )
122122 for _ , flow := range lastFlows {
123- writeBuf ("%v\n " , flow )
123+ writeBuff ("%v\n " , flow )
124124 }
125- writeBuf ("%s\n " , strings .Repeat ("-" , 500 ))
125+ writeBuff ("%s\n " , strings .Repeat ("-" , 500 ))
126126 } else {
127127 // recreate table from scratch
128128 headerFmt := color .New (color .BgHiBlue , color .Bold ).SprintfFunc ()
@@ -199,7 +199,7 @@ func updateTable() {
199199 writeBuf (keyboardError )
200200 } else {
201201 if len (regexes ) > 0 {
202- writeBuf ("Live table filter: %s Press enter to match multiple regexes at once\n " , regexes )
202+ writeBuff ("Live table filter: %s Press enter to match multiple regexes at once\n " , regexes )
203203 } else {
204204 writeBuf ("Type anything to filter incoming flows in view\n " )
205205 }
@@ -213,12 +213,12 @@ func updateTable() {
213213 }
214214}
215215
216- func writeBuf (s string , a ... any ) {
217- if len ( a ) > 0 {
218- fmt . Fprintf ( outputBuffer , s , a ... )
219- } else {
220- outputBuffer . WriteString ( s )
221- }
216+ func writeBuf (s string ) {
217+ outputBuffer . WriteString ( s )
218+ }
219+
220+ func writeBuff ( s string , a ... any ) {
221+ fmt . Fprintf ( outputBuffer , s , a ... )
222222}
223223
224224func printBuf () {
0 commit comments