Pointer vs Value

type ByteSlice []byte

func (slice ByteSlice) Append(data []byte) []byte {
		l := len(slice)
    if l + len(data) > cap(slice) {  // reallocate
        // Allocate double what's needed, for future growth.
        newSlice := make([]byte, (l+len(data))*2)
        // The copy function is predeclared and works for any slice type.
        copy(newSlice, slice)
        slice = newSlice
    }
    slice = slice[0:l+len(data)]
    copy(slice[l:], data)
    return slice
}
func (p *ByteSlice) Append(data []byte) {
    slice := *p
    // 위쪽의 body 와 똑같이 작성해요. 반환할 필요는 없구요.
    *p = slice
}
func (p *ByteSlice) Write(data []byte) (n int, err error) {
    slice := *p
    // body 는 위랑 똑같아요.
    *p = slice
    return len(data), nil
}
var b ByteSlice
fmt.Fprintf(&b, "This hour has %d days\\n", 7)