File tree 5 files changed +11
-8
lines changed
5 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -12,21 +12,21 @@ tasks:
12
12
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
13
13
go:vet :
14
14
desc : Check for errors in Go code
15
- dir : ' {{default "./" .GO_MODULE_PATH}}'
15
+ dir : " {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
16
16
cmds :
17
17
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
18
18
19
19
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
20
20
go:fix :
21
21
desc : Modernize usages of outdated APIs
22
- dir : ' {{default "./" .GO_MODULE_PATH}}'
22
+ dir : " {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
23
23
cmds :
24
24
- go fix {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
25
25
26
26
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
27
27
go:lint :
28
28
desc : Lint Go code
29
- dir : ' {{default "./" .GO_MODULE_PATH}}'
29
+ dir : " {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
30
30
cmds :
31
31
- |
32
32
if ! which golint &>/dev/null; then
41
41
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
42
42
go:format :
43
43
desc : Format Go code
44
- dir : ' {{default "./" .GO_MODULE_PATH}}'
44
+ dir : " {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
45
45
cmds :
46
46
- go fmt {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
Original file line number Diff line number Diff line change 2
2
version : " 3"
3
3
4
4
vars :
5
+ # Path of the project's primary Go module:
6
+ DEFAULT_GO_MODULE_PATH : ./
5
7
DEFAULT_GO_PACKAGES :
6
8
sh : |
7
- echo $(cd {{default "./" .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')
9
+ echo $(cd {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}} && go list ./... | tr '\n' ' ' || echo '"ERROR: Unable to discover Go packages"')
8
10
LDFLAGS :
9
11
10
12
tasks :
11
13
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/go-task/Taskfile.yml
12
14
go:build :
13
15
desc : Build the Go code
16
+ dir : " {{.DEFAULT_GO_MODULE_PATH}}"
14
17
cmds :
15
18
- go build -v {{.LDFLAGS}}
Original file line number Diff line number Diff line change 5
5
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-go-task/Taskfile.yml
6
6
go:test :
7
7
desc : Run unit tests
8
- dir : ' {{default "./" .GO_MODULE_PATH}}'
8
+ dir : " {{default .DEFAULT_GO_MODULE_PATH .GO_MODULE_PATH}}"
9
9
cmds :
10
10
- |
11
11
go test \
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Install the [`check-go-task.yml`](check-go-task.yml) GitHub Actions workflow to
12
12
13
13
- [ ` Taskfile.yml ` ] ( assets/check-go-task/Taskfile.yml ) - Linting and formatting [ tasks] ( https://taskfile.dev/ ) .
14
14
- Install to: repository root (or merge into the existing ` Taskfile.yml ` ).
15
- - [ ` Taskfile.yml ` ] ( assets/go-task/Taskfile.yml ) - ` DEFAULT_GO_PACKAGES ` variable
15
+ - [ ` Taskfile.yml ` ] ( assets/go-task/Taskfile.yml ) - ` DEFAULT_GO_MODULE_PATH ` and ` DEFAULT_GO_PACKAGES ` variables
16
16
- Merge into ` Taskfile.yml `
17
17
18
18
### Configuration
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Install the [`test-go-task.yml`](test-go-task.yml) GitHub Actions workflow to `.
14
14
15
15
- [ ` Taskfile.yml ` ] ( assets/test-go-task/Taskfile.yml )
16
16
- Install to: repository root (or merge into the existing ` Taskfile.yml ` ).
17
- - [ ` Taskfile.yml ` ] ( assets/go-task/Taskfile.yml ) - ` DEFAULT_GO_PACKAGES ` variable
17
+ - [ ` Taskfile.yml ` ] ( assets/go-task/Taskfile.yml ) - ` DEFAULT_GO_MODULE_PATH ` and ` DEFAULT_GO_PACKAGES ` variables
18
18
- Merge into ` Taskfile.yml `
19
19
20
20
### Configuration
You can’t perform that action at this time.
0 commit comments