go-bytes.Buffer

bytes.Buffer

java StringBuilder

1
2
3
4
StringBuilder sb = new StringBuilder();
sb.append("hello");
sb.append(",world");
System.out.println(sb.toString());

go bytes.Buffer

1
2
3
4
var bb bytes.Buffer
bb.WriteString("[")
bb.WriteString("]")
fmt.Println(bb.String())