package wrappers

import (
	"{{ .Source }}"
	{{ range .Package.Imports }}{{ .Package }} "{{ .Path }}"
	{{ end }}
)

{{ $pkgName := .Package.Name }}{{ range .Package.Interfaces }}type Wraps{{ .Name }} struct {
	wrapped {{ $pkgName }}.{{ .Name }}
}
{{ $ifaceRef := . }}{{ range .Methods }}func (w *Wraps{{ $ifaceRef.Name }}) {{ .Name }}({{ $methodRef := . }}{{ range $x, $e := .In }}{{ $e.Name }} {{ $e.Type }}{{ if ne $x (add (len $methodRef.In) -1)}}, {{ end }}{{ end }}) ({{ $methodRef := . }}{{ range $x, $e := .Out }}{{ $e.Type }}{{ if ne $x (add (len $methodRef.Out) -1)}}, {{ end }}{{ end }}) {
	// TODO: ADD YOUR CONTENT HERE
	{{ if ne (len $methodRef.Out) 0}}return {{ end }}w.{{ .Name }}({{ $methodRef := . }}{{ range $x, $e := .In }}{{ $e.Name }}{{ if ne $x (add (len $methodRef.In) -1)}}, {{ end }}{{ end }})
}
{{ end }}
{{ end }}

package wrappers

import (
	"{{ .Source }}"
	{{ range .Package.Imports }}{{ .Package }} "{{ .Path }}"
	{{ end }}
)

{{ $pkgName := .Package.Name }}{{ range .Package.Interfaces }}type Wraps{{ .Name }} struct {
	wrapped {{ $pkgName }}.{{ .Name }}
}
{{ $ifaceRef := . }}{{ range .Methods }}func (w *Wraps{{ $ifaceRef.Name }}) {{ .Name }}({{ $methodRef := . }}{{ range $x, $e := .In }}{{ $e.Name }} {{ $e.Type }}{{ if ne $x (add (len $methodRef.In) -1)}}, {{ end }}{{ end }}) ({{ $methodRef := . }}{{ range $x, $e := .Out }}{{ $e.Type }}{{ if ne $x (add (len $methodRef.Out) -1)}}, {{ end }}{{ end }}) {
	// TODO: Add code before the call
	{{ if ne (len .Out) 0 }}var {{ range $x, $e := .Out }}{{ $e.Name }}{{ if ne $x (add (len $methodRef.Out) -1) }},{{ end }}{{ end }} = {{ end }}w.{{ .Name }}({{ range $x, $e := .In }}{{ $e.Name }}{{ if contains "..." $e.Type.String }}...{{ end }}{{ if ne $x (add (len $methodRef.In ) -1) }},{{ end }}{{ end }})
	// TODO: Add code after the call
	return {{ if ne (len .Out) 0 }}{{ range $x, $e := .Out }}{{ $e.Name }}{{ if ne $x (add (len $methodRef.Out) -1) }},{{ end }}{{ end }}{{ end }}
}
{{ end }}
{{ end }}

Add before and after code stubs in template
Add before and after code stubs in template
