Go-注释

注释

  • 写给程序员看的,对代码的说明,包括功能、实现思路、参数说明
  • Go 单行-//
  • Go 跨行-/* */
  • Go 中只要是对包外可导入需要写上注释

Demo

// Write appends the contents of p to b's buffer.
// Write always returns len(p), nil.
func (b *Builder) Write(p []byte) (int, error) {
	b.copyCheck()
	b.buf = append(b.buf, p...)
	return len(p), nil
}
原文地址:https://www.cnblogs.com/2bjiujiu/p/14091764.html