Skip to content

Commit

Permalink
add a noCopy struct so go vet complains about copying widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Feb 8, 2025
1 parent 3795a68 commit 1d66fd2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions widget/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ import (
"fyne.io/fyne/v2/theme"
)

type noCopy struct{}

func (*noCopy) Lock() {}

func (*noCopy) Unlock() {}

// BaseWidget provides a helper that handles basic widget behaviours.
type BaseWidget struct {
noCopy // so `go vet` can complain if a widget is passed by value (copied)

size fyne.Size
position fyne.Position
Hidden bool
Expand Down

0 comments on commit 1d66fd2

Please sign in to comment.