Skip to content

Instantly share code, notes, and snippets.

@sunho
Last active January 15, 2018 22:20
Show Gist options
  • Save sunho/872a861c85384fbea87490dad75a1fdb to your computer and use it in GitHub Desktop.
Save sunho/872a861c85384fbea87490dad75a1fdb to your computer and use it in GitHub Desktop.
type ByteSlice []byte
func (p *ByteSlice) Write(data []byte) (n int, err error) {
slice := *p
// Again as above.
*p = slice
return len(data), nil
}
var b ByteSlice
fmt.Fprintf(&b, "This hour has %d days\n", 7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment