doc.go 932 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2016 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // package doc tests that Go documentation is transferred
  5. // to the generated code.
  6. package doc
  7. // F is a function.
  8. func F() {}
  9. // C is a constant.
  10. const C = true
  11. // V is a var.
  12. var V string
  13. // A group of vars.
  14. var (
  15. // A specific var.
  16. Specific string
  17. NoDocVar float64
  18. )
  19. // Before is a method.
  20. func (_ *S) Before() {}
  21. // S is a struct.
  22. type S struct {
  23. // SF is a field.
  24. SF string
  25. // blank (unexported) field.
  26. _ string
  27. // Anonymous field.
  28. *S2
  29. // Multiple fields.
  30. F1, F2 string
  31. }
  32. // After is another method.
  33. func (_ *S) After() {}
  34. // A generic comment with <HTML>.
  35. type (
  36. // S2 is a struct.
  37. S2 struct{}
  38. NoDoc struct{}
  39. )
  40. // NewS is a constructor.
  41. func NewS() *S {
  42. return nil
  43. }
  44. // I is an interface.
  45. type I interface {
  46. // IM is a method.
  47. IM()
  48. }