Skip to content

Commit bc84424

Browse files
authored
chore: allow using only github.com/go-task/task/v3/errors package (#1926)
1 parent 41884f0 commit bc84424

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

.golangci.yml

+11
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,23 @@
55

66
linters:
77
enable:
8+
- depguard
89
- goimports
910
- gofmt
1011
- gofumpt
1112
- misspell
1213

1314
linters-settings:
15+
depguard:
16+
rules:
17+
main:
18+
files:
19+
- "$all"
20+
- "!$test"
21+
- "!**/errors/*.go"
22+
deny:
23+
- pkg: "errors"
24+
desc: "Use github.com/go-task/task/v3/errors instead"
1425
goimports:
1526
local-prefixes: github.com/go-task
1627
gofmt:

cmd/release/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package main
22

33
import (
4-
"errors"
54
"fmt"
65
"os"
76
"os/exec"
@@ -12,6 +11,8 @@ import (
1211
"github.com/Masterminds/semver/v3"
1312
"github.com/otiai10/copy"
1413
"github.com/spf13/pflag"
14+
15+
"github.com/go-task/task/v3/errors"
1516
)
1617

1718
const (

internal/execext/exec.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package execext
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
76
"io"
87
"os"
@@ -14,6 +13,8 @@ import (
1413
"mvdan.cc/sh/v3/interp"
1514
"mvdan.cc/sh/v3/shell"
1615
"mvdan.cc/sh/v3/syntax"
16+
17+
"github.com/go-task/task/v3/errors"
1718
)
1819

1920
// RunCommandOptions is the options for the RunCommand func

internal/flags/flags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ package flags
22

33
import (
44
"cmp"
5-
"errors"
65
"log"
76
"os"
87
"strconv"
98
"time"
109

1110
"github.com/spf13/pflag"
1211

12+
"github.com/go-task/task/v3/errors"
1313
"github.com/go-task/task/v3/internal/experiments"
1414
"github.com/go-task/task/v3/taskfile/ast"
1515
)

precondition.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package task
22

33
import (
44
"context"
5-
"errors"
65

6+
"github.com/go-task/task/v3/errors"
77
"github.com/go-task/task/v3/internal/env"
88
"github.com/go-task/task/v3/internal/execext"
99
"github.com/go-task/task/v3/internal/logger"

0 commit comments

Comments
 (0)