Is the Go bytes.Buffer thread-safe?

前端 未结 4 2164
小蘑菇
小蘑菇 2021-02-19 05:22

In the Go programming language, is bytes.Buffer thread-safe? AFAIK, its documentation does not mention thread safety.

4条回答
  •  耶瑟儿~
    2021-02-19 05:27

    No.

    The Go documentation follows a simple rule: If it is not explicitly stated that concurrent access to something is safe, it is not.

提交回复
热议问题