Mary is playing around with Go interfaces. She wants to create a very simple Formatter interface for the Text type that implements three methods:
The
TabFormat()method — it should return a tab character"\t"+ thestring(t)The
DoubleQuoteFormat()method — it should returnstring(t)wrapped within double quotes"The
SingleQuoteFormat()method — it should returnstring(t)wrapped within single quotes'
Your task is to help Mary write the additional required code to create the three above methods and the Formatter interface that implements these methods.
This problem uses the bufio package to scan whitespace-separated strings from the standard input and save them into the someText variable. However, don't be scared! you don't need to know how the bufio package works to solve this task.