Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions unused/testdata/src/a/a.go

This file was deleted.

38 changes: 0 additions & 38 deletions unused/testdata/src/a/a.go.golden

This file was deleted.

44 changes: 0 additions & 44 deletions unused/testdata/src/agroup/agroup.go

This file was deleted.

40 changes: 0 additions & 40 deletions unused/testdata/src/agroup/agroup.go.golden

This file was deleted.

29 changes: 0 additions & 29 deletions unused/testdata/src/agroupdoc/agroupdoc.go

This file was deleted.

24 changes: 0 additions & 24 deletions unused/testdata/src/agroupdoc/agroupdoc.go.golden

This file was deleted.

7 changes: 0 additions & 7 deletions unused/testdata/src/agroupsingle/agroupsingle.go

This file was deleted.

1 change: 0 additions & 1 deletion unused/testdata/src/agroupsingle/agroupsingle.go.golden

This file was deleted.

14 changes: 0 additions & 14 deletions unused/testdata/src/b/access.go

This file was deleted.

7 changes: 0 additions & 7 deletions unused/testdata/src/b/clock.go

This file was deleted.

83 changes: 83 additions & 0 deletions unused/testdata/src/basic/basic.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package basic

// -- used as argument

type Sender interface {
Send(msg string) error
}

func Ping(sender Sender) error {
return sender.Send("ping")
}

// -- used as struct field

type MessageHandler interface {
HandleMessage(msg string) error
}

type Consumer struct {
Handler MessageHandler
}

// -- used as type cast

type Commitable interface {
Commit() error
}

func CommitAll(msgs []any) error {
for _, msg := range msgs {
c, ok := msg.(Commitable)
if !ok {
continue
}

if err := c.Commit(); err != nil {
return err
}
}

return nil
}

// grouped type declaration

type (
Executor interface { // want "^interface 'Executor' is declared but not used within the package$"
Execute() error
}

Job struct {
Name string
}

Runner interface { // want "^interface 'Runner' is declared but not used within the package$"
Run() error
}
)

// -- used as return value

type Calculator interface {
Calc() int
}

type Task struct {
A int
B int
}

func (t *Task) Calc() int {
return t.A + t.B
}

func Add(a, b int) Calculator {
return &Task{A: a, B: b}
}

// -- single type declaration

type Writer interface { // want "^interface 'Writer' is declared but not used within the package$"
Write(b []byte) error
}
Loading
Loading