-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwire.go
36 lines (26 loc) · 873 Bytes
/
wire.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package mage
import (
"context"
"github.com/dosquad/mage/dyndep"
"github.com/dosquad/mage/helper"
"github.com/magefile/mage/mg"
)
// Wire namespace is defined to group Wire functions.
type Wire mg.Namespace
// installWireBinary installs govulncheck.
func (Wire) installWireBinary(_ context.Context) error {
return helper.BinWire().Ensure()
}
// Generate install and generate golang wire dependency files.
func (Wire) Generate(ctx context.Context) error {
dyndep.CtxDeps(ctx, dyndep.Wire)
mg.CtxDeps(ctx, Wire.installWireBinary)
return helper.BinWire().Command("gen ./...").Run()
}
// Generate install and generate golang wire dependency files.
func (Wire) Lint(ctx context.Context) error {
dyndep.CtxDeps(ctx, dyndep.Lint)
dyndep.CtxDeps(ctx, dyndep.Wire)
mg.CtxDeps(ctx, Wire.installWireBinary)
return helper.BinWire().Command("check ./...").Run()
}