package main import ( "bytes" "fmt" ) func main() { buf := bytes.NewBufferString("hello") fmt.Println(buf.Len()) // 5 buf.WriteString(" world") fmt.Println(buf.Len()) // 11 buf.Reset() fmt.Println(buf.Len()) // 0 }In this example, we create a new Buffer containing the string "hello" and print its length using the Len() method. Next, we append the string " world" to the buffer using WriteString() and print the length again. Finally, we reset the buffer using Reset() and print the length one more time to show that it has been set back to 0. Package Library: "bytes" package.