Skip to content

Instantly share code, notes, and snippets.

@technosophos
Created March 19, 2014 03:18
Show Gist options
  • Select an option

  • Save technosophos/9634876 to your computer and use it in GitHub Desktop.

Select an option

Save technosophos/9634876 to your computer and use it in GitHub Desktop.
This broke the io.Multiwriter because I had Colorizer.Write() returning the number of bytes it wrote, not the number of bytes passed into it.
package main
import (
"github.com/Masterminds/cookoo"
"github.com/Masterminds/cookoo/io"
"os"
)
func main() {
_, _, cxt := cookoo.Cookoo()
l := io.NewColorizer(os.Stdout)
cxt.AddLogger("incolor", l)
cxt.AddLogger("stdout", os.Stdout)
cxt.Logf("info", "Break the logger.")
}
@technosophos
Copy link
Author

Specifically, the second logger would never log anything.

@mattfarina
Copy link

What I was wondering was, what can you pass into cxt.Logf() that causes an error. Did you have some example that you knew broke it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment