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
}
posted @ 2020-12-06 00:20  梦_鱼  阅读(130)  评论(0)    收藏  举报