error handling improvements + example
godoc