Wie erfasse ich in Go die Standardausgabe einer Funktion in einer Zeichenfolge?
In Python kann ich beispielsweise Folgendes tun:
<code>realout = sys.stdout sys.stdout = StringIO.StringIO() some_function() # prints to stdout get captured in the StringIO object result = sys.stdout.getvalue() sys.stdout = realout </code>
Schaffst du das in Go?