File: do.go

package info (click to toggle)
golang-github-dave-jennifer 1.4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 372 kB
  • sloc: makefile: 4
file content (22 lines) | stat: -rw-r--r-- 558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package jen

// Do calls the provided function with the statement as a parameter. Use for
// embedding logic.
func Do(f func(*Statement)) *Statement {
	return newStatement().Do(f)
}

// Do calls the provided function with the statement as a parameter. Use for
// embedding logic.
func (g *Group) Do(f func(*Statement)) *Statement {
	s := Do(f)
	g.items = append(g.items, s)
	return s
}

// Do calls the provided function with the statement as a parameter. Use for
// embedding logic.
func (s *Statement) Do(f func(*Statement)) *Statement {
	f(s)
	return s
}