Adding upstream version 0.0~git20250307.c2e6a77.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
be99035e76
commit
b6e042e2af
64 changed files with 10976 additions and 0 deletions
59
test/c/c.go
Normal file
59
test/c/c.go
Normal file
|
@ -0,0 +1,59 @@
|
|||
package c
|
||||
|
||||
import "time"
|
||||
|
||||
// func type comment
|
||||
type Handler func() string // after
|
||||
|
||||
type Raw []byte
|
||||
|
||||
type Example1 struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
// Example:
|
||||
//
|
||||
// Some
|
||||
// code
|
||||
// sample
|
||||
type Example2 struct {
|
||||
Title string
|
||||
Json Raw
|
||||
Bytes []byte // should be union
|
||||
}
|
||||
|
||||
func (e *Example1) DemoEx1() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
func (e *Example2) DemoEx2() time.Time {
|
||||
return time.Time{}
|
||||
}
|
||||
|
||||
// Pointer as argument vs return type
|
||||
func (e *Example2) DemoEx3(arg *Example1) (*Example1, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// ommited types
|
||||
func (e *Example2) DemoEx4(n1, n2, n3 string) {
|
||||
}
|
||||
|
||||
// ommited names
|
||||
func (e *Example2) DemoEx5(string, int) {
|
||||
}
|
||||
|
||||
// named return values
|
||||
func (e *Example2) DemoEx6() (b int, c string) {
|
||||
return
|
||||
}
|
||||
|
||||
// shortened return values
|
||||
func (e *Example2) DemoEx7() (b, c string) {
|
||||
return
|
||||
}
|
||||
|
||||
// named and shortened return values
|
||||
func (e *Example2) DemoEx8() (a int, b, c string) {
|
||||
return
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue