Add golangci-lint

https://golangci-lint.run/
This commit is contained in:
Andrey Nering
2022-05-14 21:00:15 -03:00
parent a1f9b584dc
commit 9e1d4e7855
13 changed files with 54 additions and 42 deletions

View File

@@ -53,7 +53,7 @@ func (tfs *IncludedTaskfiles) Len() int {
// Merge merges the given IncludedTaskfiles into the caller one
func (tfs *IncludedTaskfiles) Merge(other *IncludedTaskfiles) {
other.Range(func(key string, value IncludedTaskfile) error {
_ = other.Range(func(key string, value IncludedTaskfile) error {
tfs.Set(key, value)
return nil
})

View File

@@ -11,7 +11,7 @@ const NamespaceSeparator = ":"
// Merge merges the second Taskfile into the first
func Merge(t1, t2 *Taskfile, namespaces ...string) error {
if t1.Version != t2.Version {
return fmt.Errorf(`Taskfiles versions should match. First is "%s" but second is "%s"`, t1.Version, t2.Version)
return fmt.Errorf(`task: Taskfiles versions should match. First is "%s" but second is "%s"`, t1.Version, t2.Version)
}
if t2.Expansions != 0 && t2.Expansions != 2 {

View File

@@ -36,7 +36,7 @@ func (vs *Vars) UnmarshalYAML(node *yaml.Node) error {
// Merge merges the given Vars into the caller one
func (vs *Vars) Merge(other *Vars) {
other.Range(func(key string, value Var) error {
_ = other.Range(func(key string, value Var) error {
vs.Set(key, value)
return nil
})
@@ -70,7 +70,7 @@ func (vs *Vars) Range(yield func(key string, value Var) error) error {
// variables
func (vs *Vars) ToCacheMap() (m map[string]interface{}) {
m = make(map[string]interface{}, vs.Len())
vs.Range(func(k string, v Var) error {
_ = vs.Range(func(k string, v Var) error {
if v.Sh != "" {
// Dynamic variable is not yet resolved; trigger
// <no value> to be used in templates.