golang中的并发安全 指的是 同一个变量在多个goroutine中访问时需要保证其安全性。
题主提供的代码正确运行不代表就不存在并发安全问题。
在golang官方文档中明确指出并发安全问题需要锁 或者 使用队列
Advice
Programs that modify data being simultaneously accessed by multiple goroutines must serialize such access.
To serialize access, protect the data with channel operations or other synchronization primitives such as those in the sync and sync/atomic packages.
If you must read the rest of this document to understand the behavior of your program, you are being too clever. Don't be clever.
这里有java的例子
http://www.cnblogs.com/alexlo... java 非并发安全的一个例子