File: setter.go

package info (click to toggle)
golang-github-creasty-defaults 1.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 120 kB
  • sloc: makefile: 23
file content (12 lines) | stat: -rw-r--r-- 201 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
package defaults

// Setter is an interface for setting default values
type Setter interface {
	SetDefaults()
}

func callSetter(v interface{}) {
	if ds, ok := v.(Setter); ok {
		ds.SetDefaults()
	}
}