1
0
Fork 0

Adding upstream version 0.0~git20250307.c2e6a77.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-05-22 11:21:48 +02:00
parent be99035e76
commit b6e042e2af
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
64 changed files with 10976 additions and 0 deletions

36
test/a/interfaces.go Normal file
View file

@ -0,0 +1,36 @@
package a
import "time"
type Empty interface{}
// unexported interface
type interfaceA[T any] interface {
// some comment
unexportedFunc()
// some comment above the function
Method0()
Method1() string // inline comment
// multi
// line
// comment
Method2(argA, argB string) (T, int)
Method3(argA int, argB ...string) (T, []string, error)
}
// multi
// line
// comment
type InterfaceB interface {
Empty
interfaceA[int]
// "replace" Method0 from interfaceA
Method0()
CustomMethod() time.Time
}

49
test/a/structs.go Normal file
View file

@ -0,0 +1,49 @@
package a
type unexported struct {
field0 string
Field1 string
}
// structA comment
type structA struct {
Field1 string // after
// multi
// line
// comment
// with union type
Field2 []byte
}
func (s structA) method0() {}
// method comment
func (s structA) Method1(arg1 int) {}
func (s *structA) Method2(arg1 int, arg2 ...string) {} // after
// structB comment
type StructB[T any] struct {
*unexported
structA
Field3 T
}
// StructB.Method3 comment
func (s *StructB[T]) Method3(arg1 int) (a int, b string, c error) {
return
}
// structC with multiple mixed generic types
type StructC[A string, B, C any] struct {
Field4 A
Field5 B
Field6 C
}
// StructC.Method4 comment
func (s *StructC[A, B, C]) Method4(arg1 A) (a B, b C, c error) {
return
}

76
test/a/vars.go Normal file
View file

@ -0,0 +1,76 @@
// package a docs
// lorem ipsum dolor...
package a
import "time"
// -------------------------------------------------------------------
// variables (note: currently are ignored)
// -------------------------------------------------------------------
var unexportedVar int = 123
// comment
var VarA = 123 // after
var VarB any = "test"
// external package type
var VarC time.Time = time.Now()
// chan
var VarD = make(chan int)
// composite
var VarE = map[string]func(){"test": func() {}}
// -------------------------------------------------------------------
// constants
// -------------------------------------------------------------------
const unexportedConst = "123"
// comment
const ConstA string = "test" // after
// multi
// line
// comment
const ConstB = 123
// some generic group comment
const (
ConstC0 = iota
ConstC1 // after
ConstC2
)
// -------------------------------------------------------------------
// type alias with methods
// -------------------------------------------------------------------
// type comment
type SliceAlias[T any] []T // after
// func comment
func (s SliceAlias[T]) funcA() {
}
// multi
// line
// comment
func (s SliceAlias[T]) funcB(argA, argB int) {
}
func (s SliceAlias[T]) funcC(argA int, argB ...string) (a T, b int, c error) {
return
}
// -------------------------------------------------------------------
// function type
// -------------------------------------------------------------------
// multi
// line
// comment
type Handler[T comparable] func() (T, int) // after